[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem with newline character

Subject: Problem with newline character
From: Charles Pugh <charles.pugh@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 8 Dec 2004 14:42:51 -0000
xml newline character
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.