XSLT C# DocType Missing

  • Thread starter Thread starter andy
  • Start date Start date
A

andy

Hi all,

I have the following lines in my XSLT file:

<?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"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
indent="yes" />


and my C# looks like:
private void generatePage(XmlDocument xDoc, string xsltPath,
XsltArgumentList xslArg)
{
XslTransform xst = new XslTransform();
string absPath = xsltPath;
xst.Load(absPath);
XmlTextWriter writer = new XmlTextWriter(Response.Output);
writer.Formatting = Formatting.Indented;
writer.Indentation = 4;
xst.Transform(xDoc, xslArg, writer, new XmlUrlResolver());
}

It all works okay aside from it is missing the DocType declaration,
which is clearly not ideal.

Have you any ideas why this is the case? What is necessary to get the
DocType output correctly?

Additionally, are you aware of any performance tweaks for the XSLT
procedures, something I can use to get every bit of performance out of
it?

Thanks guys / girls,

Andy
 
Back
Top