SV: [xsl] output encoding problem (can't get UTF-8)

Subject: SV: [xsl] output encoding problem (can't get UTF-8)
From: "Gabriel K" <gabriel.klappenbach@xxxxxxxxxxxx>
Date: Fri, 5 Aug 2005 21:29:06 +0200
Well that looks good... I can't understand why my transform totally messes
up E D V.
E is transformed to %C3%83%E2%80%A6 for some reason, and so on.

/Gabriel

> -----Ursprungligt meddelande-----
> Fren: Joe Fawcett [mailto:joefawcett@xxxxxxxxxxx]
> Skickat: den 5 augusti 2005 20:29
> Till: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Dmne: Re: [xsl] output encoding problem (can't get UTF-8)
>
>
> ----- Original Message -----
> From: "Gabriel K" <gabriel.klappenbach@xxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Friday, August 05, 2005 6:15 PM
> Subject: SV: [xsl] output encoding problem (can't get UTF-8)
>
>
> The ASP file is:
> http://gabbah.no-ip.org/mirakel/default.asp.txt
>
> I sometimes read the XML file from disk statically, but most of the time
> it
> comes from a COM-object.
>
> Basically it's:
>
> set o = Server.CreateObject("MwebbCOM.MwebbCOM.1")
> domXML.loadXML(o.Document)
>
> And that's the XML file you get, the one I reffered to below.
>
> /Gabriel
>
> Well this asp page
>
> <% @Language="JavaScript" %>
> <%
>
>   var URL =
> "http://gabbah.no-
> ip.org/mirakel/default.asp?ctype=STP&cdoc=object&cnMaxRows=10&cnBookmark=H
> 2856&cpKNP=*&transform=no";
>   var XSLT = "simple.xslt";
>
>   function getSyncDom()
>   {
>     var oDom = new ActiveXObject("Msxml2.FreeThreadedDomDocument.4.0");
>     oDom.async = false;
>     return oDom;
>   }
>
>   function getServerHttpRequest()
>   {
>     return new ActiveXObject("Msxml2.ServerXmlHttp.4.0");
>   }
>
>   function getXslTemplate()
>   {
>     return new ActiveXObject("Msxml2.XSLTemplate.4.0");
>   }
>
>   function main()
>   {
>     var oHttpReq = getServerHttpRequest();
>     oHttpReq.open("GET", URL, false);
>     oHttpReq.send();
>     //Response.ContentType = "text/xml";
>     var oXslt = getSyncDom();
>     oXslt.load(Server.MapPath("simple.xsl"));
>     var oTemplate = getXslTemplate();
>     oTemplate.stylesheet = oXslt;
>     var oProc = oTemplate.createProcessor();
>     oProc.input = oHttpReq.responseXML;
>     oProc.output = Response;
>     oProc.transform();
>   }
>
>   main();
>
> %>
>
> with this stylesheet:
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> xmlns:ns="http://www.mirakel.nu/xml";
>   version="1.0">
>   <xsl:output method="html" media-type="text/html" encoding="UTF-8"
> indent="no"
> omit-xml-declaration="yes"
>     doctype-public="-//W3C//DTD HTML 4.01//EN"
> doctype-system="http://www.w3.org/TR/html4/strict.dtd"; />
>   <xsl:template match="/">
>     <html>
>       <head>
>         <title>Simple Transform</title>
>       </head>
>       <body>
>         <xsl:value-of select="*/ns:MARKdescr" />
>       </body>
>     </html>
>   </xsl:template>
> </xsl:stylesheet>
>
> shows the characters correctly. I have IE 6 set to auto-select.
>
> --
>
> Joe

Current Thread