[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] MSXML2 and encoding


Subject: Re: [xsl] MSXML2 and encoding
From: Steve Freeman <smfreeman@xxxxxxxxxxx>
Date: Tue, 19 Aug 2003 17:02:18 -0400

Teresa,

You need to specify an output instruction, ala:

<xsl:output method="xml" encoding="UTF-8" version="1.0"/>

Steve

Teresa Rippeon wrote:

Whenever I tranform one XML file to another using MSXML2, I get the XML
processing instruction with an encoding value of "UTF-16" ( <?xml
version="1.0" encoding = "UTF-16">). Of course, then when the file is
launched in IE 6, I get the error that it can't switch to the specified
encoding. I really just want either no encoding specified or encoding =
"UTF-8". I've even tried specifying an encoding of "UTF-8". Any advice?

Here's the beginning of my stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:output indent="yes" media-type="xml" encoding="UTF-8"></xsl:output>


And here's the VB code for using MSXML2, if that helps...


'Load the XML data
Set source_xml = New MSXML2.DOMDocument30
source_xml.async = False
source_xml.Load (source_doc)
If (source_xml.parseError.errorCode <> 0) Then
GoTo Errorhandling
End If
'Load the stylesheet
Set tranform_stylesheet = New MSXML2.DOMDocument30
tranform_stylesheet.async = False
tranform_stylesheet.Load (stylesheet_doc)
If (tranform_stylesheet.parseError.errorCode <> 0) Then
GoTo Errorhandling
End If


new_xml_string = source_xml.transformNode(tranform_stylesheet)

Thanks!!!

Teresa


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list





XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords
xml