[Bug 10097] New: Whitespace stripping and error XTRE0270

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10097

           Summary: Whitespace stripping and error XTRE0270
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 2.0
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


A comment about xsl:strip-space/preserve-space. Relates to issue 4 in the XSLT
2.1 draft, but also has relevance to XSLT 2.0.

1. We say that error XTRE0270 occurs if "this" leaves more than one match,
where "this" is the process of determining whether an element name belongs to
the set of whitespace-preserving element names. But we don't say what element
names this process is applied to. Is it all elements in the instance document?
Or all elements that are parents of whitespace text nodes? Is it legitimate to
apply the process to all element names appearing in the schema? Or even to the
infinite set of all possible element names?

2. We allow you to say

<xsl:strip-space elements="p:*"/>
<xsl:preserve-space elements="*:local"/>

and this is in fact the only situation in which you can get a conflict between
strip|preserve declarations at the same precedence and priority that can't be
detected statically (in all other cases, the error can only arise if you
actually have the same NameTest in both declarations, so static detection is
trivial). Since we allow you to say this, and don't give you any way to specify
the relative priority of the two declarations, it seems to me unreasonable that
when you do this you should run the risk of a run-time error.

It would be nice if we could fix this by giving *:local a higher default
priority than p:*, but this change would be too disruptive.

So my suggestion would be to change the rules as follows:

a. It is a STATIC error if the same NameTest (needs definition) appears in both
an xsl:preserve-space declaration and an xsl:strip-space declaration at the
same precedence.

b. There is no dynamic error if an element matches both an xsl:strip-space and
an xsl:preserve-space declaration at run-time; rather, we always apply the rule
"last declaration wins".

Rule (a) would be a backwards-incompatibility.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 6 July 2010 08:26:23 UTC