I am trying to output a fragment of html code. But I need it to be pretty-printed/indented.
Is there any way to do this without using <xsl:text>
</xsl:text>
and <xsl:text>	</xsl:text>
?
I have used the following line without any results.
<xsl:output method="html" indent="yes"/>
Follwoing is the c# code;
XslCompiledTransform XSLT = new XslCompiledTransform();
XSLT.Load(xslPath);
using (XmlTextWriter writer = new XmlTextWriter(writePath, null))
{
if (isTopLevel)
{
XSLT.Transform(XMLDocumentForCurrentUser, writer);
}
else
{
XsltArgumentList xslArg = new XsltArgumentList();
xslArg.AddParam("MenuIndex", "", menuIndex);
XSLT.Transform(XMLDocumentForCurrentUser, xslArg, writer);
}
}
// I write the output to file
//All this works fine, only now I need the HTML to be readable (in the browser's view source or any notepad)
Does anybody know of a way to format(atleast indent) XSLT output?
xsl:output/@indent
(maybe because it's no good like in MSXSL) and you don't want to do it manualy, then there is no solution in the scope of XSLT, but because you put such restrictions. – Rifexsl:output
. Just that, it simply showed no results for me. – Deprivation