xsl-list
[Top] [All Lists]

Re: [xsl] Source code formatting

2020-08-19 08:09:07
Am 19.08.2020 um 15:02 schrieb Willem Van Lishout
willemvanlishout(_at_)gmail(_dot_)com:

I'm having a little trouble with converting whitespace entities.
This line:

<xsl:variable name="nl" select="'&#10;'"/>

Gets converted to:

<xsl:variable name="nl" select="
"/>

Which causes the variable to be output as a space when I do
<xsl:value-of select="$nl"/> (I suppose because it gets normalized again
during parsing).

I wonder what the best way is to solve this problem? It's not important
what it looks like, but the stylesheet behavior should obviously not
change. The formatting is done by an XSL stylesheet (which removes
whitespace-only nodes), which uses the aforementioned patched Xerces
parser and then uses a custom Saxon serializer to control output
indentation and new line settings. Is this something I could configure
in the serializer?


Does the normal Saxon serializer preserve the numeric character reference?
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>