Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML not in UTF-8 format
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00872117
Message ID:
00872964
Vues:
16
Hi Michel,

this is a code-snippet which shows how I create an UTF-8-encodes xml-file
with msxml2.
this.oxml = createobject("msxml2.domdocument"+"."+this.cParserversion)
this.oXML.async = .F.
* XML-Deklaration anlegen
this.oxml.validateonParse = .F.
cxmlstart = ""

IF LEN(ALLTRIM(this.cEncode)) == 0
   cEnc = "UTF-8"
ELSE
   cEnc = ALLTRIM(this.cEncode)
Endif

IF this.lUseDTD
   cURL = this.cDTD
   cxmlstart = "<?xml version=" + CHR(34)+"1.0"+CHR(34) + " encoding=" +;
               CHR(34)+cEnc+CHR(34) + " ?>"
   cxmlstart = cxmlstart + CHR(13) + CHR(10)
   cxmlstart = cxmlstart + "<!DOCTYPE ONIXmessage SYSTEM " + CHR(34) + cURL
+
CHR(34) +;
            "><DUMMY/>"
   this.oxml.loadXML(cxmlstart)
   this.oxml.RemoveChild(this.oxml.ChildNodes(2))
else
   cxmlstart = "version=" + CHR(34) + "1.0" +CHR(34) + " encoding=" +
CHR(34) + cEnc
+ CHR(34)
   oDec = this.oxml.createProcessinginstruction('xml',cxmlstart)
   this.oxml.insertBefore(oDec,this.oxml.childnodes.item(0))
endif
*****
Hope this helps

Thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform