xsl-list
[Top] [All Lists]

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

2006-04-26 02:56:14
Hi, 

-----Ursprüngliche Nachricht-----
Von: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Gesendet: Dienstag, 25. April 2006 22:42
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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