Forum Stats

  • 3,875,498 Users
  • 2,266,930 Discussions
  • 7,912,236 Comments

Discussions

How to append new elements into a existing UBL xml

User_VLXMC
User_VLXMC Member Posts: 1 Green Ribbon

Hi please see the below sample UBL xml.

<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">

<cbc:ProfileID>reporting:1.0</cbc:ProfileID>

</Invoice>

how can I append new element before <cbc:ProfileID> element and after that.

sample append element:

<ext:UBLExtensions>

    <ext:UBLExtension>

      <ext:ExtensionURI>urn:oasis:names:specification:ubl:dsig:enveloped:xades</ext:ExtensionURI>

      <ext:ExtensionContent>

        <sig:UBLDocumentSignatures xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2" xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2" xmlns:sig="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2">

          <sac:SignatureInformation>

</sac:SignatureInformation>

        </sig:UBLDocumentSignatures>

      </ext:ExtensionContent>

    </ext:UBLExtension>

  </ext:UBLExtensions>

Tagged: