Re: Detecting a linefeed in input text, how?

Subject: Re: Detecting a linefeed in input text, how?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 09 Aug 2000 19:35:41 +0100
Steve,

>I'm processing a node that has embedded line feed characters.  I'm 
>trying to output the original lines, but with spaces added to the front.  
>I wrote the following template, but it doesn't detect the line feeds:
[snip]
>Any ideas?

A couple.

First is that '#0A' is, in XML, literally the string '#0A'.  To get a
linefeed character, try using the character entity reference '&#x0A;' instead.

The other thing that immediately springs to mind is to make sure that
whitespace is being preserved in the 'indenter' element within your XML
source.  If it isn't, then any line feeds are going to be interpreted as
spaces.  To prevent this happening, set xml:space="preserve" on that
element (or in the DTD).

Your template scans OK otherwise.

I hope that helps,

Jeni

Dr Jeni Tennison
Epistemics Ltd * Strelley Hall * Nottingham * NG8 6PE
tel: 0115 906 1301 * fax: 0115 906 1304 * email: jeni.tennison@xxxxxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread