[Home] [By Thread] [By Date] [Recent Entries]
----- Original Message -----
From: "Gabriel K" <gabriel.klappenbach@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, August 05, 2005 6:15 PM Subject: SV: output encoding problem (can't get UTF-8)
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=H2856&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
|

Cart



