W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2001

[afo@zurich.ibm.com] Interpreting QName in XPath expression for <field> element

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 25 Jun 2001 15:40:41 +0100
To: www-xml-schema-comments@w3.org
Message-ID: <f5blmmgmxli.fsf@cogsci.ed.ac.uk>



attached mail follows:





Hi,

I would like to have your point of view on the way QName appearing in XPath
expression for a <field>  should be interpreted.
Here is an example extracted from the primer :

<schema targetNamespace="http://www.example.com/Report"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:r="http://www.example.com/Report"
        xmlns:xipo="http://www.example.com/IPO"
        elementFormDefault="qualified">

<import namespace="http://www.example.com/IPO"/>

 <element name="purchaseReport">
  <complexType>
   <sequence>
    <element name="regions" type="r:RegionsType">
     <keyref name="dummy2" refer="r:pNumKey">
      <selector xpath="r:zip/r:part"/>
      <field xpath="@number"/>
     </keyref>
    </element>

    <element name="parts" type="r:PartsType"/>
   </sequence>
   <attribute name="period"       type="duration"/>
   <attribute name="periodEnding" type="date"/>
  </complexType>

 </element>

 <complexType name="RegionsType">
  <sequence>
   <element name="zip" maxOccurs="unbounded">
    <complexType>
     <sequence>
      <element name="part" maxOccurs="unbounded">
       <complexType>
        <complexContent>
         <restriction base="anyType">
          <attribute name="number"   type="xipo:SKU"/>
          <attribute name="quantity" type="positiveInteger"/>
         </restriction>
        </complexContent>
       </complexType>
      </element>
     </sequence>
     <attribute name="code" type="positiveInteger"/>
    </complexType>
   </element>
  </sequence>
 </complexType>
</schema>

In <field xpath="@number"/>, since the default namespace (the namespace
without prefix) is http://www.w3.org/2001/XMLSchema, I think "@number"
refers to the qualified attribute
{http://www.w3.org/2001/XMLSchema}{number}.  However, there is no such
attribute in {http://www.example.com/Report}{zip}/
{http://www.example.com/Report}{part} ("number" attribute defined there is
unqualified). According to me, this example extracted from the primer is
invalid.
What do you think?

Thanks,
Achille.






-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Monday, 25 June 2001 10:40:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT