xsl-list
[Top] [All Lists]

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

2003-07-12 09:14:03
...

I tell again I DONT have problems with that.
Your url
(http://www.biglist.com/lists/xsl-list/archives/200108/msg00541.html) deal
with LOAD. I load what I want (ISO-iso-8859-1, UTF-8, Windows-1251) without
any problems! My work are OK!! with dom.transformNode(xsl)) All utf-8
caracter are OK (*even if it's utf-16)!

My request it's so simple, How browser can open that UTF-8 encoding without
problem?
No ASP, NO SERVER SIDE PARSE, no css, JUST ONE xml/xsl direct on IE or
Mozilla.

Try our self : http://www.trucsweb.com/rss/sauve3.asp
NOTE :   ééé are UTF-8 encoding

All code :

My XML (utf-8 encoding)
alone direct in IE or Mozilla browser
(dont work)
======================
<?xml version="1.0" encoding="UTF-8"?>
<test>
   ééé
</test>

My XML (utf-8 encoding) with XSL
direct in IE or Mozilla browser
(dont work)
=========================
// utf.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="utf.xsl"?>
<test>
   ééé
</test>

My XSL
=========
// utf.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
 <xsl:output method="html" encoding="UTF-8"/>

 <xsl:template match="/">
    <xsl:copy-of select="." />
 </xsl:template>

</xsl:stylesheet>

My XML/XSL (utf-8 encoding) parse with ASP "ransformNode"
==>> (WORK PERFECTLY!!!)
============================
  set xml = Server.CreateObject("Msxml2.DOMDocument.4.0")
  xml.async = false
    xml.load(Server.MapPath("utf.xml"))
    set xsl = Server.CreateObject("Msxml2.DOMDocument.4.0")
    xsl.async = false
      xsl.load(Server.MapPath("utf.xsl"))
      Response.Write("Result with xml.transformNode(xsl) work good!")
      Response.Write(twParse(xml.transformNode(xsl)))
    set xsl = nothing
  set xml = nothing

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



"[Tech]" <tech(_at_)oznogco(_dot_)com> wrote in message
news:011601c34875$ef9aa9d0$0200a8c0(_at_)NEO2(_dot_)(_dot_)(_dot_)
Ok, you just dont understand my poor english!
I dont have problem with load or parse !!!!!
Tx for you time.

It is not at all your English. In your previous message you wrote:

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


You are using the transformNode() method. It is returning a BSTR and this
is
UTF-16.

Regardless of whatever you do the output will be UTF-16.

As I already pointed out, the solution is to use transformNodeToObject()
and
pass to it the response object as parameter, or to use IXSLProcessor and
set
its output property to the response object.


This must have been put in the xslt-FAQ, but I didn't find it there:

http://www.biglist.com/lists/xsl-list/archives/200108/msg00541.html


=====
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