xsl-list
[Top] [All Lists]

Problem with newline character

2004-12-08 07:42:51
Hi

I am trying to perform an XML to Text file transformation in a C#.Net 
application.

Here is a simple Style sheet that demonstrates my problem:

<?xml version="1.0" encoding="UTF-8"?>
<xslt:stylesheet version="1.0" 
xmlns:xslt="http://www.w3.org/1999/XSL/Transform";>

<xslt:output method="text" indent="no"/>

  <xslt:template match="/">
  
    <xslt:text>Start</xslt:text>
    <xslt:text>&#xa;</xslt:text>
        <xslt:text>End</xslt:text>
        
  </xslt:template>
  
</xslt:stylesheet>


and the code C# I use to transform the XML to text is:

//Load the xml document
XmlDocument doc = new XmlDocument();
doc.Load(textBox1.Text);

// Create an XPathNavigator to use for the transform.
XPathNavigator nav = doc.CreateNavigator();

// Transform the file.
XslTransform xslt = new XslTransform();
xslt.Load(textBox2.Text);
XmlTextWriter writer = new 
XmlTextWriter(textBox3.Text,System.Text.Encoding.Default);
xslt.Transform(nav, null, writer, null);
writer.Close();

But my output file is always:

Start End

When viewed in Microsoft notepad.exe.

Can any one help?

Thanks in advance.

Charles

**********************************************************************************************
Don't miss the Aligned Assets and Laser-Scan Corporate Data Management Seminar 
on Tuesday 14th December! Find out more and book your place at 
http://www.aligned-assets.co.uk/seminar 
**********************************************************************************************
The information contained in or attached to this message is the responsibility 
of the sender and is meant for the confidential use of the intended recipients. 
 It does not necessarily represent the position of Aligned Assets.  If you are 
not an intended recipient you are notified that you have received this 
communication in error and that review, dissemination or copying of this 
communication is prohibited.

If you have received this in error, please notify us.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>