[WD] XML Creation

Startbeitrag von Gianni Spano am 23.07.2017 13:44

Hello to all

I'm creating an XML file and i have a few questions to post here.

1) How to change the first line created by my program? Some parameter to use? :


Hi Gianni,

I don't know if there is another way, but once the file is created, you can simply use the replace function to replace the original first line by yours

Best regards

von Fabrice Harari - am 23.07.2017 15:24
Hello Fabrice

Thanks for your response.

Yes, i thought the same approach..but i wanted to know if there were any other ways.

Thanks again

von Gianni Spano - am 23.07.2017 18:28

you can add it:

PROCEDURE Constructor()

xmlfact..Encoding = "UTF-8"
nNamespace1 is xmlNamespace
nNamespace2 is xmlNamespace
nNamespace3 is xmlNamespace
nNamespace4 is xmlNamespace
nNode is dynamic xmlNode
nNode = xmlfact.Invoice

nNamespace4..URI = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" //1
nNamespace3..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" //2
nNamespace3..Name = "cac" //2
nNamespace2..Name = "cbc"
nNamespace2..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"//3
nNamespace1..Name = "xsi"
nNamespace1..URI = "http://www.w3.org/2001/XMLSchema-instance";

Add(nNode..NamespaceDeclared, nNamespace4)
Add(nNode..NamespaceDeclared, nNamespace3)
Add(nNode..NamespaceDeclared, nNamespace2)
Add(nNode..NamespaceDeclared, nNamespace1)

nNode:schemaLocation..Value = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd";
nNode:schemaLocation..Namespace = nNamespace1

This stuff is needed for an ubl invoice


von Allard - am 24.07.2017 16:34
Hello Allard

Thank you for your suggestion


von Gianni Spano - am 24.07.2017 17:57
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.