This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xml:space, xsl:strip-space etc.
- To: xsl-list at mulberrytech dot com
- Subject: xml:space, xsl:strip-space etc.
- From: Nick Browne <NickBrowne at slipstone dot co dot uk>
- Date: Thu, 26 Oct 2000 18:49:46 +0100
- Organization: Slipstone Ltd
- Reply-To: xsl-list at mulberrytech dot com
I am trying to work out the implications of using the xml:space
attribute when used with XSLT processors. My understanding from the XSLT
spec is that when this value is set to "preserve" for an element,
whitespace only descendants of the element are always retained. This is
true whatever values of xsl:strip-space/xsl:preserve-space may have been
used.
However, what is the meaning of the "default" value for this attribute ?
The spec does not seem to define what a processor should do in this
case. Possible interpretations are :
1. Preserve whitespace nodes for any element with this attribute value
since the initial set of whitespace preserving elements contains all
element names.
2. Use the result after applying the xsl:strip-space/xsl:preserve-space
elements.
My tests on Oracle and Saxon give differing results once xml:space is
introduced. Saxon appeared to remove all text nodes if "default" (and
"preserve" !) is used . Oracle seems to apply the result following
application of xsl:strip-space.
Perhaps the anwser is simple, don't use the xml:space attribute with
XSLT as the xsl: elements give all the control that is needed. Is this a
reasonable suggestion ?
--
Nick Browne
Slipstone Ltd
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list