XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Mark MaltbySubject: Carriage returns and line feed crlf
Author: Mark Maltby
Date: 20 Jun 2006 09:07 AM
What is the best way to retain crlf in xml files? Is it best to use CDATA tags

Postnext
Ivan PedruzziSubject: Carriage returns and line feed crlf
Author: Ivan Pedruzzi
Date: 20 Jun 2006 11:25 AM

If you like to have full control on whitespace add the following attribute to the element root in your XML document

xml:space='preserve'

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Mark MaltbySubject: Carriage returns and line feed crlf
Author: Mark Maltby
Date: 20 Jun 2006 12:20 PM
This doesn't seem to work with the below example. What am i doing wrong?

<?xml version="1.0"?>

<t xml:space='preserve'>
this is a test for line feed
asdknaslkdnklansda
asd
as
d
asd
as
d
as
d
asd
a
sd
asd
</t>

Postnext
Ivan PedruzziSubject: Carriage returns and line feed crlf
Author: Ivan Pedruzzi
Date: 20 Jun 2006 01:39 PM

In which sense doesn't work?

If try to indent the document posted the end of lines should be respected.

Thank you for you help
Ivan Pedruzzi
Stylus Studio Team

Postnext
Mark MaltbySubject: Carriage returns and line feed crlf
Author: Mark Maltby
Date: 21 Jun 2006 04:19 AM
If I use the above xml and place t into a table cell, you will see from the screen shot that the carriage returns are not respected.


Imagecrlf.JPG

Postnext
Tony LavinioSubject: Carriage returns and line feed crlf
Author: Tony Lavinio
Date: 21 Jun 2006 08:44 AM
Well, that's a different story.

It looks like you are outputting HTML.

HTML does not respect CR and LF in files. All white space is collapsed
into single spaces, including tabs and line endings.

You must turn them into <BR> elements.

Posttop
Mark MaltbySubject: Carriage returns and line feed crlf
Author: Mark Maltby
Date: 21 Jun 2006 09:31 AM
Oh. That would explain it. Thanks for your help.

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.