This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The syntax for patterns allows a NameTest, and one permitted form of a NameTest is "BracedURILiteral *", for example match="Q{http://www.w3.org/x}*". The construct is particularly useful because it allows match="Q{}*", which matches elements in no namespace; there is no other convenient way of expressing this test. The rules for default priority of patterns in section ยง6.5 do not handle this case explicitly. A literal reading of the rules means that it takes the "all other cases" rule 11, with a priority of +0.5. However, a much more reasonable interpretation would be that Q{uri}* is equivalent to p:*, which comes under rule 9, and gives a default priority of -0.25.
I am committing test case match-261, with an expected result that assumes a default priority of -0.25 for this case.
(In reply to Michael Kay from comment #0) > A literal reading of the rules means that it takes the "all other cases" > rule 11, with a priority of +0.5 Actually, I don't think so. I think it matches Rule 10, "any other NodeTest", for which the production rules include the "BracedURILiteral *". This would yield a default priority of -0.5. > However, a much more reasonable interpretation would be that Q{uri}* is > equivalent to p:*, which comes under rule 9, and gives a default priority of > -0.25. I agree, and I think we should treat this as a clarification of the text, if possible, since anything else than -0.25 as explained in point 7 (which I read as the 'half wildcard' rule) seems odd.
There is a further complication here. Consider the case match="element(*:local)" Rule 7 says it applies "If the pattern is a PathExprP taking the form of an ElementTestXP30 or AttributeTestXP30, optionally preceded by a ForwardAxisP", but it does not cover this case. The entry for element(E) does not apply, because E "represents an arbitrary element name", and not a wildcard. It seems intuitive that this should come under rule 9, and get a priority of -0.25. But then what about element(*:local, xs:integer)? This doesn't seem to be covered at all. Note that this problem applies equally to XSLT 2.0. Recommendation: if W is a wildcard then: (1) element(X) and attribute(X) are always treated the same as X and @X, so if X is a "partial wildcard" (A:* or *:A) then it has priority -0.25 (2) if X is a partial wildcard then element(X, T) and attribute(X, T) are treated the same as element(*, T) and attribute(*, T), getting a priority of 0. (In principle, element(X, T) is more specific than element(*, T) and less specific than element(E, T), but we really don't want to introduce another priority level between 0 and 0.25).
Forget comment (3). Partial wildcards are not allowed in an ElementTest or AttributeTest; the syntax element(*:X) or element(X:*) is not allowed. Silly me for expecting orthogonality.
Covered by draft erratum E37, see https://htmlpreview.github.io/?https://github.com/w3c/qtspecs/blob/master/errata/xslt-30/html/xslt-30-errata.html#E37