J
Jeroen
We're using MSXML to transform the XML document we have to an XHTML
file using an XSLT. Now the problem is that the dotnet implementation
we made does something subtly different from the commandline call to
MSXML. The problem is that the dotnet variant leaves out a piece of
info on the charset, leading to the browser going to a default encoding
instead of the wanted UTF-8.
MSXML2.DOMDocument40Class stylesheet = new
MSXML2.DOMDocument40Class();
stylesheet.async = false;
source.validateOnParse = false;
stylesheet.load(xsls);
string s = source.transformNode(stylesheet);
System.IO.TextWriter file = System.IO.File.CreateText("path.html");
file.Write(s);
Note that the xslt has a line:
<xslutput method="html" indent="yes" encoding="UTF-8" />
This code creates a meta tag different from the commandline version:
<META http-equiv="Content-Type" content="text/html">
Whereas the commandline version of MSXML nicely outputs.
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
Anyone have a clue how to do this? Do I need a
CreateProcessingInstruction for the stylesheet?
file using an XSLT. Now the problem is that the dotnet implementation
we made does something subtly different from the commandline call to
MSXML. The problem is that the dotnet variant leaves out a piece of
info on the charset, leading to the browser going to a default encoding
instead of the wanted UTF-8.
MSXML2.DOMDocument40Class stylesheet = new
MSXML2.DOMDocument40Class();
stylesheet.async = false;
source.validateOnParse = false;
stylesheet.load(xsls);
string s = source.transformNode(stylesheet);
System.IO.TextWriter file = System.IO.File.CreateText("path.html");
file.Write(s);
Note that the xslt has a line:
<xslutput method="html" indent="yes" encoding="UTF-8" />
This code creates a meta tag different from the commandline version:
<META http-equiv="Content-Type" content="text/html">
Whereas the commandline version of MSXML nicely outputs.
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
Anyone have a clue how to do this? Do I need a
CreateProcessingInstruction for the stylesheet?