[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: output encoding problem (can't get UTF-8)

Subject: Re: output encoding problem (can't get UTF-8)
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Fri, 5 Aug 2005 19:28:36 +0100
get encoding from xml
----- 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)

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")

And that's the XML file you get, the one I reffered to below.


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);
   //Response.ContentType = "text/xml";
   var oXslt = getSyncDom();
   var oTemplate = getXslTemplate();
   oTemplate.stylesheet = oXslt;
   var oProc = oTemplate.createProcessor();
   oProc.input = oHttpReq.responseXML;
   oProc.output = Response;



with this stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://www.mirakel.nu/xml"
<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="/">
<title>Simple Transform</title>
<xsl:value-of select="*/ns:MARKdescr" />

shows the characters correctly. I have IE 6 set to auto-select.



Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.