W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2005

[Bug 2125] R-136: Question about selector XPath expressions

From: <bugzilla@wiggum.w3.org>
Date: Fri, 09 Sep 2005 16:05:07 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1EDlND-0008JT-F0@wiggum.w3.org>


           Summary: R-136: Question about selector XPath expressions
           Product: XML Schema
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSD Part 1: Structures
        AssignedTo: ht@w3.org
        ReportedBy: sandygao@ca.ibm.com
         QAContact: www-xml-schema-comments@w3.org

Is the following invalid? 

<xsd:element name="root">
      <xsd:element name="Book" maxOccurs="unbounded">
            <xsd:element name="isbn" type="xsd:string"/>
          <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:key name="BookKey">
          <xsd:selector xpath="."/>
          <xsd:field xpath="isbn"/>
The point to note here is that the selector XPath contains the expr '.' 

The XMLSchema Rec says:

[[ {selector} specifies a restricted XPath ([XPath]) expression relative to 
instances of the element being declared. This must identify a node set of 
subordinate elements (i.e. contained within the declared element) to which the 
constraint applies.


Further, 3.11.4 The Identity-constraint Definition Validation Rules, states:

[[ Validation Rule: Identity-constraint Satisfied 

For an element information item to be locally valid with respect to an identity-
constraint all of the following must be true:

1 The {selector}, with the element information item as the context node, 
evaluates to a node-set (as defined in [XPath]). [Definition:] Call this the 
target node set. 

2 Each node in the target node set is an element node among the descendants of 
the context node.

3 ....


Looking at point 2 above, it reflects that, '.' cannot be used as the XPath 
expr for a selector. Does *descendants of the context node* include the context 

On the other hand the production rule for the XPath expr for the selector 
allows '.' as a valid XPath expr. 

A clarification is requested.

Received on Friday, 9 September 2005 16:05:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:04 UTC