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

Forwarded message 1

  • From: afo@zurich.ibm.com <afo@zurich.ibm.com>
  • Date: Mon, 25 Jun 2001 14:11:05 +0200
  • Subject: Interpreting QName in XPath expression for <field> element
  • To: w3c-xml-schema-ig@w3.org
  • Message-ID: <C1256A76.0042C368.00@d12mta01.de.ibm.com>
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 UTC