Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XSLT Encoding problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00667481
Message ID:
00668736
Vues:
14
Hi Bud,

How are you saving the phisical file? The transformation will produce an XML document with the default XML Declaration (xml version="1.0"). This will make IE assume that the document is encoded in UTF-8/UTF-16. In order for this to work, the phisical file must be saved with one of these encodings.

Assume you have an XML file named "Hello.xml" and an stylesheet file named "Hello.xsl". The following code transforms the XML document and produces an output XML file encoded as Unicode:
LOCAL loXML as "MSXML2.DOMDocument.4.0"
LOCAL loXSL as "MSXML2.DOMDocument.4.0"
LOCAL lcEncodedStr

loXML = CREATEOBJECT("MSXML2.DOMDocument.4.0")
loXSL = CREATEOBJECT("MSXML2.DOMDocument.4.0")

loXML.Load("\Hello.xml")
loXSL.Load("\Hello.xsl")

lcEncodedStr = STRCONV(loXML.TransformNode(loXSL), 9)
STRTOFILE(lcEncodedStr, "\out.xml", 4)

loIE = CREATEOBJECT("InternetExplorer.Application")
loIE.Navigate("\out.xml")
loIE.Visible = .T.
This file can be properly opened by IE .

HTH.
-----
Fabio Vazquez
http://www.fabiovazquez.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform