E
Electric Co.
Hello,
I am trying to write a small xslt utility to build and quickly check my
transforms. Unfortunately, I can not figure out how have the output
from the transform written to the console with indent and newline
formatting intact.
ie. Console Code:
XPathDocument myXPathDocument = new XPathDocument
("../../XMLFile1.xml", XmlSpace.Preserve);
XslTransform myXslTransform = new XslTransform();
XmlTextWriter writer = new XmlTextWriter("transform.xml", null);
myXslTransform.Load("../../XSLTFile1.xslt");
myXslTransform.Transform(myXPathDocument, null, writer, new
XmlUrlResolver());
writer.Close();
stream = new StreamReader ("transform.xml");
Console.Write(stream.ReadToEnd());
Transform:
:
:
</xsl:element>
<xsl:value-of select="'\n'"/>
</xsl:for-each>
This just write the string literal "/n".
Any help would be appreciated.
I am trying to write a small xslt utility to build and quickly check my
transforms. Unfortunately, I can not figure out how have the output
from the transform written to the console with indent and newline
formatting intact.
ie. Console Code:
XPathDocument myXPathDocument = new XPathDocument
("../../XMLFile1.xml", XmlSpace.Preserve);
XslTransform myXslTransform = new XslTransform();
XmlTextWriter writer = new XmlTextWriter("transform.xml", null);
myXslTransform.Load("../../XSLTFile1.xslt");
myXslTransform.Transform(myXPathDocument, null, writer, new
XmlUrlResolver());
writer.Close();
stream = new StreamReader ("transform.xml");
Console.Write(stream.ReadToEnd());
Transform:
:
:
</xsl:element>
<xsl:value-of select="'\n'"/>
</xsl:for-each>
This just write the string literal "/n".
Any help would be appreciated.