General information
Title:
Problem with XSLT and encoding
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only