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

Re: Recognizing new line character in XSL

Subject: Re: Recognizing new line character in XSL
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 20 Jul 2010 13:21:22 +0200
Re:  Recognizing new line character in XSL
Siddhi Thakkar wrote:

Could you please guide me if there is any way in XSL to recognize new
line character and display each line as a new paragraph? I am not
sure of the Unicode entity of new line char, if we really need it we
can assume it to be &#xa; I am using JDOM as processor and xsl
version 1.0.

You can read in XML data and output XML or HTML or plain text with XSLT
1.0. Any XML input and any stylesheet is parsed by an XML parser first
which normalizes white space and line breaks, see
http://www.w3.org/TR/xml/#sec-line-ends
http://www.w3.org/TR/xml/#AVNormalize
that is all you need to be aware of.
So you are right, &#10; or &#xA; is a way to put a line break into an XML input document or an XSLT stylesheet.
On the other hand you have not told us what your output format is, if it's HTML and you want to display paragraphs or lines then you need to construct the proper HTML e.g. 'p' elements for paragraphs or 'br' elements to have line breaks.



--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.