W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

[Q] Qualify XPath Steps for Identity Constraints?

From: Andy Clark <andyc@apache.org>
Date: Mon, 29 Jan 2001 18:30:12 -0800
Message-ID: <3A762734.E103E918@apache.org>
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
As I'm implementing identity constraints in Xerces, I have
the following question: must steps in the XPaths used for
selectors and fields of identity constraints be fully
qualified? This only applies when the grammar specifies a
target namespace, of course.

I raise the question because a sample grammar in the primer 
(report.xsd in section 5) doesn't qualify the steps but this
seems to contradict the way you must reference names declared 
within a namespace.

For example, I must qualify element references when used
within a namespace, like so:

  <schema xmlns='http://www.w3.org/2000/10/XMLSchema'
          targetNamespace='NS'
          xmlns:ns='NS'>
   <element name='foo'>
    <...>
     <element ref='ns:bar'/>
    <...>
   </element>
   <element name='bar'>
    <...>
   </element>
  </schema>

But not for XPaths used for selectors and fields of
identity constraints, like so:

  <schema xmlns='http://www.w3.org/2000/10/XMLSchema'
          targetNamespace='NS'
          xmlns:ns='NS'>
   <element name='foo'>
    <...>
    <unique>
     <selector xpath='bar'/>
     <field xpath='@baz'/>
    </unique>
   </element>
  </schema>

Is this inconsistency intended? I couldn't tell from looking
at the primer or structures parts of the specification.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org
Received on Monday, 29 January 2001 21:34:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT