xsl-list
[Top] [All Lists]

Re: [xsl] Recognizing new line character in XSL

2010-07-20 06:21:39
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 
 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, 
 or 
 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/

--~------------------------------------------------------------------
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>