[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] codepoints-to-string for new line


Subject: Re: [xsl] codepoints-to-string for new line
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sun, 8 Sep 2013 15:10:10 +0100

There are places in the XQuery/XPath test suite where we use
codepoints-to-string(10) to generate a newline, for the reasons you cite: it's
less likely than other representations to be corrupted by operations on the
source file such as XSLT transformations. There's another reason in that case
as well, which is that XQuery expands entities in string literals, while XPath
does not.

Michael Kay
Saxonica

On 8 Sep 2013, at 00:04, Heiko Niemann wrote:

> Hello,
>
> whenever I searched for a way to insert a line break using the output text
> method I basically just found samples either with & #10; or a line break
> inside a xsl:text element. Those work as long as you don't do pretty print
> or your editor at some point transforms & #10; to space. Anyhow while
> flipping thru a well known XSLT/XPath reference codepoints-to-string()
> crossed my way - and solved the problem. So that makes me wonder:
>
> a) Is there a good reason/scenario why/when not to use this function for a
> line break?
>
> b) Are there just no (top-rated) samples around because
> codepoints-to-string() belongs to an extended set of functions that people
> (like me) rarely/never use?
>
>
> Thanks for hints,
> Heiko


Current Thread
Keywords