XMLInvoice
Check the type of XML document and throw an exception if invalid
This commit is contained in:
parent
22ec6c8029
commit
427eb77fd9
2 changed files with 13 additions and 1 deletions
|
|
@ -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 = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue