This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XSLT error "Switch from current encoding to specified encoding no t supported"


I have a similar problem, but outputing html (MSXML July Ed).

First, it seems that the fact that ASP strings are UTF-16 (?)
doesn't allow for the use of the iso-8859-1 encoding/version
xml line.

Second, even if xsl:output mentions output encoding = iso8859-1,
the xslt processor ignores this line and adds a META encoding
line of UTF-16.

The same XML/XSL-T worked fine in the may tech preview.

joão martins


Friedlander, Hal arranhou no interstício de um copo:
>XSLT error "Switch from current encoding to specified encoding not
>supported"
>
>Attempting to transform XML source doc to XML result via XSL stylesheet
>and MSXML.
>
>I get the following error. "Switch from current encoding to specified
>encoding not supported"
>And ..encoding="UTF-16"?> is added to the <?xml version="1.0" declaration.
>
>How do i prevent the "switch" and remove the encoding statement? Source
>code is below. Thanks very much
>-Hal Friedlander
>
>
>XML SOURCE
><?xml version="1.0"?>
><book title="Essential XML">
>   <author name='Don'   age='25' canadian='false'/>
>   <author name='Aaron' age='19' canadian='false'/>
>   <author name='John'  age='20' canadian='true'/>
></book>
>
>XSL SOURCE
><?xml version='1.0' ?>
><doc xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>xsl:version='1.0'><xsl:copy-of select='/book/author'/></doc>
>
>ASP SOURCE
><%
>Option Explicit
>
>Dim oXML, oXSL
>
>Set oXML = server.CreateObject("MSXML2.FreeThreadedDOMDocument")
>Set oXSL = server.CreateObject("MSXML2.FreeThreadedDOMDocument")
>
>Call oXML.load(Server.MapPath("msdnsample3.xml"))
>if oXML.parseError.line > 0 then
>         Response.Write oXML.parseerror.reason
>         Response.End
>end if
>
>Call oXSL.Load(Server.MapPath("msdnsample3.xsl"))
>
>if oXSL.parseError.line > 0 then
>         Response.Write oXSL.parseerror.reason
>         Response.End
>end if
>
>Call Response.Write(oXML.transformNode(oXSL))
>
>Set oXSL = Nothing
>Set oXML = Nothing
>%>
>
>RESULT XML SOURCE
><?xml version="1.0" encoding="UTF-16"?>
><doc>
><author name="Don" age="25" canadian="false" />
><author name="Aaron" age="19" canadian="false" />
><author name="John" age="20" canadian="true" />
></doc>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--
,--------------------[ Espreite: http://www.queroter.com ]-----------------.
| http://www.terravista.pt/BaiaGatas/3612 OU http://planeta.clix.pt/neves/ |
`---------------------------[ jota@link.pt ]-------------------------------'
                  Design & Comunicação Interactiva @ LINK


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]