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

Is this <xs:unique> correct?

From: Kevin Burges <xmldude@burieddreams.com>
Date: Thu, 13 Sep 2001 17:33:21 +0100
Message-ID: <18032281003.20010913173321@burieddreams.com>
To: xmlschema-dev@w3.org

If I have a schema representing a document like this:

<file>
  <group>
    <field name="field1"/>
    <datefield name="field1"/>
  </group>
  <section>
    <field name="field3"/>
  </section>
</file>


And I have the following xs:unique defined in the <file> element:

<xs:unique name="FieldName">
  <xs:selector xpath=".//datefield | .//field"/>
  <xs:field xpath="@name"/>
</xs:unique>


Should that make the instance document above invalid (as there are two
fields called "field1")?

I've tried this in XMLSpy4, which seems to claim full W3C Schema
compliance, and it does not give me an error.

-- 
May the flares be with you,
 Kevin                    mailto:xmldude@burieddreams.com

++++++++++++ Cool music - http://burieddreams.com/marshan
++++++ Attitude Webzine - http://burieddreams.com/attitude
Received on Thursday, 13 September 2001 12:35:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC