Re: [xsl] MSXML / NBSP problem and resolution

Subject: Re: [xsl] MSXML / NBSP problem and resolution
From: "Michael H. Semcheski" <mhs-list@xxxxxxxxx>
Date: Thu, 07 Nov 2002 11:21:15 -0500


As I understand it, "Auto-Select" in IE means "if there's no charset parameter
given in the Content-Type HTTP response header or in the equivalent META
element in the HTML document itself, then make an intelligent guess at the
document's encoding". So once you set Response.CharSet in the server, you
force the output to be transcoded to the encoding you choose, and it is
reported correctly in the HTTP headers, thus bypassing the auto-select logic in the client.


So your problem is just that you've still got the erroneous meta tag, right? I
think you will be able to fix it if you make sure that your stylesheet uses
<xsl:output method="html" encoding="iso-8859-1"/> and that you follow Andy's
examples to avoid storing your output in intermediate String objects.



Changing the encoding in the output method node does not seem to affect the meta tag inserted by MSXML right after the head, as long as the output method="html".


As I said earlier, it can be overridden by adding a response.charset at the top of the ASP page. The meta tag still appears, but presumably IE ignores the meta tag if the charset is explicitly defined in the http header.

The other alternative, as Thomas Nielsen pointed out, is to change the output method to xml, and add the meta node into the result document after the transformation. The downside of this, in my opinion, is that the method="html" output text is nicer to read and easier to debug, not a production issue, but for development its a PITA. Adding any whitespace to the document with output=xml (eg, indent="yes") sometimes changes the way the browser renders the page.


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



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



Current Thread