469,632 Members | 1,732 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,632 developers. It's quick & easy.

xslt console whitespace newline

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.

Aug 16 '06 #1
0 1210

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by qwweeeit | last post: by
2 posts views Thread by Wolfgang Jeltsch | last post: by
4 posts views Thread by Dwayne Epps | last post: by
2 posts views Thread by Daniel Walzenbach | last post: by
25 posts views Thread by Peter Michaux | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.