Discussion Locked

How to recognize newline in XSLT?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm having a devil of a time trying to get
my XSLT script to replace all occurrences
of the newline character with a newline
followed by a tab. The problem is, I can't
figure out how to express the newline
character so the expression
can match it. The code is:

where I've used to set $newLine
to a variety of values, but none have worked.
I've tried \n, \\n,
and probably others
I've forgotten. Another I'vetried is:

None of these has matched the newline in
the string contained in $tail.
I've checked using the Unix od(1) command
and found that the numeric value of the
character I'm tring to match is decimal 10
(shows as 0a in the "od -xc" output).

I'm tempted now to try to use an xsl
extension to JavaScript to try to do the
algorithm there, but I'd really rather
stick with just xsl.

Thanks.

5 replies

This discussion is closed to new replies.