Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with XSLT and encoding
Message
From
29/07/2003 10:56:11
Martin Van Krieken
Capgemini Nederland Bv
Utrecht, Netherlands
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Problem with XSLT and encoding
Miscellaneous
Thread ID:
00814530
Message ID:
00814530
Views:
58
Hello,

I'm trying to transform an XML document into another XML document using an XSLT style sheet. I use this code to do the translation:


loXml = CREATEOBJECT('MsXml2.DOMDocument')
loXml.async = .F.
loXml.load(lcXml)

lcXsl = 'MyStyleSheet.xsl'
loXsl = CREATEOBJECT('MsXml2.DOMDocument')
loXsl.async = .F.
loXsl.load(lcXsl)

lcXml = loXml.transformNode(loXsl)
STRTOFILE(lcXml, 'Test.xml', 0)


The result is an XML document with an encoding attribute of "UTF-16", while both my XML and XSLT document don't have any encoding attribute. When I try to open the Test.xml I get this error:

Switch from current encoding to specified encoding not supported.

So although the encoding attribute says it's UTF-16, the file is not encoded this way. However, I can't find a way to set the encoding of the result XML document.

Any ideas?


TIA,

Martin
Next
Reply
Map
View

Click here to load this message in the networking platform