Multiple xsl:strip-space and xsl:preserve-space declarations

The spec (section 3.4) is very confusing in this area.

The definition comes in two parts. The first part appears to describe an
algorithm: "initially the set of whitespace-preserving names contains all
names, if an element matches an xsl:strip-space it is removed from the list,
if it matches an xsl:preserve-space it is added to the list". The suggestion
is that these rules are applied sequentially, with the implication that if I

<xsl:strip-space elements="title"/>
<xsl:preserve-space elements="title"/>

(in either order) then whitespace will be preserved for the title element.

But then the spec goes on to talk about conflict resolution in terms of
rules having precedence and priority, and this part of the spec suggests
that the above is an error, which the implementor can either report or
recover from, and if he chooses to recover, then the order of declarations
is significant. Further, the spec doesn't define what it means by
"conflict", it doesn't say whether

<xsl:strip-space elements="title title"/>

is a conflict, or whether
<xsl:strip-space elements="title"/>
<xsl:strip-space elements="title"/>

is a conflict; the fact that conflict resolution it is defined by reference
to template rules suggests that it is a conflict, because there is no
suggestion with template rules that a conflict doesn't arise if two
templates have the same effect.

I can't reconcile the algorithmic part of the specification with the
rule-based part at all. They give quite different answers.

Mike Kay

Received on Friday, 10 December 1999 05:25:30 UTC