xslt console whitespace newline

Discussion in 'ASP .Net' started by Electric Co., Aug 16, 2006.

  1. Electric Co.

    Electric Co. Guest

    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.
     
    Electric Co., Aug 16, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oli Filth
    Replies:
    9
    Views:
    3,333
    Uncle Pirate
    Jan 17, 2005
  2. Matt
    Replies:
    2
    Views:
    1,122
    Joris Gillis
    Nov 2, 2004
  3. Ben Finney
    Replies:
    2
    Views:
    997
    Egor Bolonev
    Jun 30, 2003
  4. Replies:
    10
    Views:
    748
    Eric Brunel
    Dec 16, 2008
  5. MRAB
    Replies:
    3
    Views:
    389
Loading...

Share This Page