I need to sign different xml types: Invoice, CreditNote and DebitNote, and this different types are at te top of each xml:
<fe:Invoice
<fe:CreditNote
<fe:DebitNote
How can i know which kind of xml i'm going to sign?
i'm loading the XML files with this code:
Code |
---|
$xmlDocument = new TElXMLDOMDocument();
$xmlDocument->LoadFromFile($file);
|
I've tried with several methods of TElXMLDOMDocument whitout any success, and all this is to use the same PHP script to sign any of those xml, because my script adds Namespaces to select the specific node where i need to place the signature:
Code |
---|
$nsMap->AddNamespace('ext', 'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2');
$nsMap->AddNamespace('fe', 'http://xxxxxx/yyyyyyy/zzzzzzz')
$nodeSet = $xmlDocument->SelectNodes('/fe:Invoice/etc/etc/etc/etc', $nsMap);
|
or
Code |
---|
$nsMap->AddNamespace('ext', 'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2');
$nsMap->AddNamespace('fe', 'http://xxxxxx/yyyyyyy/zzzzzzz')
$nodeSet = $xmlDocument->SelectNodes('/fe:DebitNote/etc/etc/etc/etc', $nsMap);
|
or
Code |
---|
$nsMap->AddNamespace('ext', 'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2');
$nsMap->AddNamespace('fe', 'http://xxxxxx/yyyyyyy/zzzzzzz')
$nodeSet = $xmlDocument->SelectNodes('/fe:CreditNote/etc/etc/etc/etc', $nsMap);
|
See the small change at third line in the above codes.
Thank you in advance.