AW: [xsl] xsl:for-each and xml:space with text-nodes inbetween

Subject: AW: [xsl] xsl:for-each and xml:space with text-nodes inbetween
From: "Buchcik, Kasimier" <k.buchcik@xxxxxxxxxxxx>
Date: Wed, 26 Apr 2006 11:55:59 +0200
Hi,

> -----Urspr|ngliche Nachricht-----
> Von: Michael Kay [mailto:mike@xxxxxxxxxxxx]
> Gesendet: Dienstag, 25. April 2006 22:42
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: RE: [xsl] xsl:for-each and xml:space with text-nodes
> inbetween
>
>
> XSLT 2.0 spells the rules out in great detail:
>
> http://www.w3.org/TR/xslt20/#stylesheet-stripping

I see; you refer to 5) of the whitespace-stripping section of
XSLT 2.0 (I abviously overlooked that one):
"Any whitespace text node whose following-sibling node is an
xsl:param or xsl:sort element is removed from the tree,
regardless of any xml:space attributes."

> In 1.0 I think that a strict reading of the spec tells you
>
> (a) whitespace text nodes in the stylesheet are not stripped if
> xml:space="preserve" is specified (section 3.4)
>
> (b) Text nodes, however snowy-white they are, are not
> permitted as children
> of an element such as xsl:choose, or before the xsl:sort child of
> xsl:for-each (section 18)
>
> This is the interpretation that I adopted in Saxon; but it's somewhat
> severe, and it's not surprising that some XSLT 1.0 processors
> have chosen a
> more liberal approach. We made an explicit decision to adopt the more
> liberal approach in XSLT 2.0, if only because it's more
> consistent with the
> rules for XML validity in the presence of a DTD.

OK. I think I'll go the Saxon way here for XSLT 1.0.

[...]

Regards & thanks,

Kasimier

Current Thread