XMLInvoice

Check the type of XML document and throw an exception if invalid
This commit is contained in:
sparkyx 2025-11-29 09:01:53 +01:00
parent 22ec6c8029
commit 427eb77fd9
2 changed files with 13 additions and 1 deletions

View file

@ -35,6 +35,7 @@ namespace Noalyss\XMLDocument;
* Exception code :
* - 55 : XML Invalid
* - 62 : filename don't exist
* - 140: not a credit note
* Namespace standard (from XSD)
*
* Array
@ -135,6 +136,10 @@ class XMLCreditNote_Reader extends XML_Reader
{
$result = [];
$node = $this->get_node("//cac:CreditNoteLine");
if ($node == null )
{
throw new \Exception ("XC140 invalide document",140);
}
for ($e = 0; $e < $node->length; $e++)
{
$row = [];