xslt - 'charset=UTF-16' is missing in the transformation result with MSXML4.0 -


I have some problem about" Charset "in the change result with different versions of MSXML. The

With MSXML3.0 code below HTML will transform XML

  dim xmlDoc New MSXML2.DOMDocument xmlDoc.async = false dim strXML string strXML = "& lt as as result & gt; & lt; ElapsedTime & gt; & from 3000 lt; / ElapsedTime & gt; & lt; / result & gt; "XmlDoc.loadXML (strXML) new Msaksmel as dim Aksseldik 2 Kfri Threddeddommaks XslDoc.async = string Strks Selel as string Selel = "C: \ Test.akssel" xslDoc.load (strXSL) dim XSLT new Msaksmel 2. XSL template xslt.stylesheet = as xslDoc as xslProc dim MSXML2.IXSLProcessor xslProc = xslt.createProcessor xslProc.input = xmlDoc xslProc.transform () Debug.Print (xslProc.output)  
< P> ========== ==============================

" Test.xsl "is the content of,

   

===============================

This Output is,

  & lt; Html & gt; & Lt; Top & gt; & Lt; META http-equiv = "content-type" content = "text / html; charset = UTF-16" & gt; & Lt; Title & gt; Report & lt; / Title & gt; & Lt; / Head & gt; & Lt; / Html & gt;  

I'm not sure why charset is always set on the way MSXML3.0

the "UTF-16" with

====== ===== ==============

Then I use MSXML4 to change the code, like this,

  Dim xmlDoc as New MSXML2.DOMDocument40 .. dim xslDoc New MSXML2.FreeThreadedDOMDocument40 ... Dim xslt in as New MSXML2.XSLTemplate40 ...  

============= ==== ====

At this time, output is

   

No charset outputs in MSXML4.0.

=====================

Can you please tell me who is right? In general MSXML is useless in getting the right character encoding.

For some strange reasons, they chose UTF-16 as the default charset.

But you can add this line after xsl: stylesheet line:

    

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -