This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Detecting a linefeed in input text, how?


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 '
' 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@epistemics.co.uk


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]