PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD22 - XML Node prefix
WD22 - XML Node prefix
Débuté par Giovanni Carella, 20 avr. 2018 12:55 - 1 réponse
Posté le 20 avril 2018 - 12:55
Hi,
i use an xml schema named "FatturaElettronica", the schema is this:

https://drive.google.com/open…

The code i use is this:

FatEle is xmlDocument, description = FatturaElettronica NamSpace is xmlNamespace Node is dynamic xmlNode Node = FatEle.FatturaElettronica NamSpace..Name = "xsi" NamSpace..URI="http://www.w3.org/2001/XMLSchema-instance" Add(Node..NamespaceDeclared,NamSpace) Node:schemaLocation..Value="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2/Schema_del_file_xml_FatturaPA_versione_1.2.xsd" Node:schemaLocation..Namespace=NamSpace NamSpace..Name = "ds" NamSpace..URI="http://www.w3.org/2000/09/xmldsig" Add(FatEle.FatturaElettronica..NamespaceDeclared,NamSpace) NamSpace..Name = "p" NamSpace..URI="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" Add(FatEle.FatturaElettronica..NamespaceDeclared,NamSpace) FatEle.FatturaElettronica:versione="FPR12" "OTHER CODE TO ADD DATA" XMLSave(FatEle,sNomefile,XMLFormatting)
The result is this:

https://drive.google.com/open…

What is the method to add a prefix "p" to root "FatturaElettronica"???
I'm going crazy
Posté le 21 avril 2018 - 04:23
Hi,

I use this for ubl invoicing ( simple invoicing ) in Holland.:

sPath_Pdf is string
sPath is string
xmlfact is xmlDocument ,description="UBL-Invoice"
//xmlfact = XMLOpen("UBL-Invoice.xml")
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

Hope this gives some insight

regards
Allard