[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] =?UTF-8?Q?Problem_with_newline_character?=


Subject: [xsl] Problem with newline character
From: Charles Pugh <charles.pugh@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 8 Dec 2004 14:42:51 -0000

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.


Current Thread
Keywords