xsl-list
[Top] [All Lists]

Re: Re: Microsoft.XMLDOM UTF-8 Encoding!

2003-07-12 06:03:05
Ok, you just dont understand my poor english!
I dont have problem with load or parse !!!!!
Tx for you time.

----- Original Message ----- 
From: "Dimitre Novatchev" <dnovatchev(_at_)yahoo(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Saturday, July 12, 2003 8:56 AM
Subject: [xsl] Re: Microsoft.XMLDOM UTF-8 Encoding!



"[Tech]" <tech(_at_)oznogco(_dot_)com> wrote in message
news:004201c34868$957de3c0$0200a8c0(_at_)NEO2(_dot_)(_dot_)(_dot_)
I repeat,

I dont have problem to parse the XML. All caracters are UTF-8 encoding.
So response.write(dom.transformNode(xsl)) show the writh thing!

This is a FAQ:

  Either use:

          dom.transformNodeToObject(xsl, response)

or use IXSLTemplate, IXSLProcessor -- the slightly modified example from
the MSXML4 SDK is:

var xslt = new ActiveXObject("Msxml2.XSLTemplate.4.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample2.xsl");
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;

xslProc.output = response;  //  <===   this is the important line of code

xslProc.transform();


What happens is that whenever a string variable is set to the result of
the
transformation, this result is converted into UTF-16, because a string in
any MS scripting language and VB is of type BSTR, that is 16 bit Unicode.

This can be avoided in one of the above ways, by setting the result
transformation directly into a stream object, without an intermediate
conversion to string.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL





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




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