xsl-list
[Top] [All Lists]

Re: MSXML / NBSP problem and resolution

2002-11-07 10:17:18


The question then, is MSXML 3.0 broken because it adds the meta node into the result set if output method="html"?

No it is _mandated_ to add a meta element  by the XSLT spec.
It has to place a meta element reflecting the encoding it actually used
rather than the encoding you request in xsl:output.
This makes sense so far...

If you call msxml so that it produces a dom or similar in memory
representation then it always uses utf16 and ignores the requested output
encoding. If you ask it to output to a file or string then it will use
the encoding you request if it is supported on your platform.


The way do a transformation in MSXML with ASP:

const XSL = "structure.xsl"
const XML = "data.xml"
Set xmldoc = Server.CreateObject("MSXML2.DOMDocument.3.0")
Set xsldoc = Server.CreateObject("MSXML2.DOMDocument.3.0")

xmldoc.Load Server.MapPath(XML)
xsldoc.Load Server.MapPath(XSL)

strOutput = xmldoc.transformNode(xsldoc)
response.write strOutput

So what you are saying makes sense except that the transformNode returns a string, not an XML document or node set, so the encoding should be what I requested and not encoding of the internal DOM.

i.e., I still don't understand why it is adding that meta tag into the output. (though there is a lot more light on the subject now.)

Mike


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