xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] IE error | Switch from current encoding to specified encoding not supported.


Subject: RE: [xsl] IE error | Switch from current encoding to specified encoding not supported.
From: "Scott Trenda" <Scott.Trenda@xxxxxxxx>
Date: Wed, 3 Oct 2007 11:57:39 -0500

Out of curiosity, why not just...

<xsl:output encoding="utf-8" omit-xml-declaration="yes"/>

...? ASP might be overriding it in transform() (this is the same
[mis]behavior as IE's JScript XSLTProcessor.transform()), which is why
the string-replace works in the end, but it may be worth a shot.

~ Scott


-----Original Message-----
From: Steve [mailto:subsume@xxxxxxxxx]
Sent: Wednesday, October 03, 2007 11:53 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] IE error | Switch from current encoding to specified
encoding not supported.

Works great!

One mystifying problem: in IE the result is:

 <?xml version="1.0" encoding="ISO-8859-15" ?>
  <i>Not logged in</i>

Why is this appearing? (In Firefox all is well)

On 10/3/07, W Charlton <XSLList@xxxxxxxxxx> wrote:
> Steve,
>
> If you are using ASP then you will need to add a replace function.
>
> Below is a snip of some code we use.
>
> Set XSLTemp = Server.CreateObject(MSXML2.XSLTemplate.3.0)
>       Set XSLTemp.stylesheet = XSLDoc 'variable set higher up in page
e.g.
> c:\myfiles\myxsl.xsl
>       Set XSLProc = XSLTemp.createProcessor
>       XSLProc.input = XMLDoc 'variable set higher up in page e.g.
> c:\myfiles\myxsl.xml
>       XSLProc.addParameter "MyParam", "MyParamValue"
>      XSLProc.transform
>      Response.Charset = "ISO-8859-15"
>
>      Response.Write Replace(XSLProc.output, "UTF-16", "ISO-8859-15")
>
> If you want UTF-8 replace ISO-8859-15 (Latin 1 extended) with UTF-8
>
>
> William Charlton
> The yMonda team
> yMonda Limited
> w: www.ymonda.net
>
>
> -----Original Message-----
> From: Steve [mailto:subsume@xxxxxxxxx]
> Sent: 2007 October 03 17:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] IE error | Switch from current encoding to
specified
> encoding not supported.
>
> Sorry. MSXML is the processor.
>
> -Steve
>
> On 10/3/07, W Charlton <XSLList@xxxxxxxxxx> wrote:
> > Steve,
> >
> > You don't say what processor you are using. I suspect it may be a
Windows
> MS
> > flavour which deals with output streams as utf16.
> >
> > We have had to override this in the past by replacing the encoding
on
> > writing to the screen.
> >
> >
> > William Charlton
> > The yMonda team
> > yMonda Limited
> > w: www.ymonda.net
> >
> > -----Original Message-----
> > From: Steve [mailto:subsume@xxxxxxxxx]
> > Sent: 2007 October 03 16:58
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: Re: [xsl] IE error | Switch from current encoding to
specified
> > encoding not supported.
> >
> > Sure do!
> >
> > On 10/3/07, Scott Trenda <Scott.Trenda@xxxxxxxx> wrote:
> > > Do you have <xsl:output encoding="utf-8"/> at the top of your
> > > stylesheet? I know my server-side XSLT processor chokes on UTF-16
> > > output.
> > >
> > > ~ Scott
> > >
> > > -----Original Message-----
> > > From: Steve [mailto:subsume@xxxxxxxxx]
> > > Sent: Wednesday, October 03, 2007 10:53 AM
> > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject: [xsl] IE error | Switch from current encoding to
specified
> > > encoding not supported.
> > >
> > > I'm confused by this error I am receiving in IE. I've never
> > > encountered anything like it and I'm confused as to why the below
> > > template would trigger such an error.
> > >
> > > Strangely, the stylesheet begins with:
> > >
> > > <?xml version='1.0' encoding="UTF-8"?>
> > >
> > > not UTF-16 as in the error.
> > >
> > > ------
> > > Error
> > >
> > > Switch from current encoding to specified encoding not supported.
> > > Error processing resource 'https://server.org/private...
> > >
> > > <?xml version="1.0" encoding="UTF-16"?><i>Not logged in</i>
> > >                         ---------------------------------------^
> > >
> > > ==========
> > >
> > > XSL template
> > >
> > > <xsl:template match="/">
> > >         <xsl:choose>
> > >                 <xsl:when test="$userID or $noAuth='true'">
> > >                         <xsl:choose>
> > >                                 <xsl:when test="$Mode='index'">
> > >                                         <xsl:apply-templates
select="/"
> > > mode="index" />
> > >                                 </xsl:when>
> > >                                 <xsl:when test="$Mode='search'">
> > >                                         <xsl:choose>
> > >                                                 <xsl:when
test="$R">
> > >
> > > <xsl:apply-templates select="/" mode="search" />
> > >                                                 </xsl:when>
> > >                                                 <xsl:otherwise>
> > >                                                         <h2>No
> > > results</h2>
> > >                                                 </xsl:otherwise>
> > >                                         </xsl:choose>
> > >                                 </xsl:when>
> > >                                 <xsl:when test="$Mode='report'">
> > >                                         <xsl:apply-templates
select="/"
> > > mode="report" />
> > >                                 </xsl:when>
> > >                                 <xsl:otherwise>
> > >                                         <xsl:call-template
> > > name="warning" />
> > >                                         <xsl:apply-templates />
> > >                                         <xsl:call-template
> > > name="warning" />
> > >                                 </xsl:otherwise>
> > >                         </xsl:choose>
> > >                 </xsl:when>
> > >                 <xsl:otherwise>
> > >                         <i>Not logged in</i>
> > >                 </xsl:otherwise>
> > >         </xsl:choose>
> > > </xsl:template>


Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor