Subject: Re: [xsl] LF and serialize()?|
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Oct 2019 13:08:12 -0000
When I run serialize() (in Saxon-HE 220.127.116.11J XSLT) over an XML snippet, it
does what I need, except that it replaces LF inside attribute values with SP. This seems to be consistent with what I read at https://www.w3.org/TR/REC-xml/#AVNormalize, and the workaround described there (use a numerical character reference to LF instead of the raw LF character) works. But Ibd like to avoid having to specify in the XML something that I would prefer to manage during the XSLT transformation, and I would also like to avoid pre-processing the XML outside an XML environment and replacing the LF with a numerical character reference there, before passing the modified XML into the XSLT transformation.
So: Would anyone happen to know of a way within just an XSLT stylesheet to
retain LF within an attribute value as distinct from SP in the output of serialize()?
What is an XML snippet? Are you sure it is the serialization that converts linefeeds to spaces or just the XML parsing (that is also what the spec you cite refers to)?