This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6686 - xsl:xpath-default-namespace should apply to expressions, not only patterns
Summary: xsl:xpath-default-namespace should apply to expressions, not only patterns
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-11 15:25 UTC by Frans Englich
Modified: 2009-03-11 15:46 UTC (History)
0 users

See Also:


Attachments

Description Frans Englich 2009-03-11 15:25:51 UTC
Section 5.2 Unprefixed QNames in Expressions and Patterns says that xpath-default-namespace applies to, among other things, "any unprefixed element name or type name used in a pattern".

However, I think it also should apply to any XPath expession, such as found in xsl:sequence/@select. For instance, I think this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

    <xsl:template match="/">
        <xsl:sequence xpath-default-namespace="TEST" select="e"/>
    </xsl:template>

</xsl:stylesheet>

should match on the input document <e xmlns="TEST"/>. I think that would be inline with what the spec intended(e.g, consider the name of the attribute), and how people expect it to function.

Maybe I have missed something, but perhaps an editorial change in the direction of turning "any unprefixed element name or type name used in a pattern" into "any unprefixed element name or type name used in a pattern or expression", would be useful.
Comment 1 Michael Kay 2009-03-11 15:37:21 UTC
The text immediately prior to the sentence you quote is:

For any element in the stylesheet, the effective value of this attribute determines the value of the default namespace for element and type names in the static context of any XPath expression contained in an attribute of that element (including XPath expressions in attribute value templates)....

The effective value of this attribute similarly applies to any of the following constructs appearing within its scope:

* any unprefixed element name or type name used in a pattern

I can't really see how to make it much clearer. Perhaps the reader's eye is drawn to the bulleted list, which you then expect to be a complete list of all the places where xpath-default-namespace is used?
Comment 2 Frans Englich 2009-03-11 15:46:07 UTC
Dear god, no, that's exactly what I was looking for. Sorry for the, quite spectacular, noise.