W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2003

Redefine?

From: Nigel Hardy <nwh@aber.ac.uk>
Date: Mon, 02 Jun 2003 13:57:56 +0100
Message-ID: <3EDB49D4.20203@aber.ac.uk>
To: xmlschema-dev@w3.org
The listing below sets the (simplified) scene. An element "List" 
contains and number of As and Bs. I'm happy with that schema.

I then want to create an alternative schema with an additional identity 
constraint, viz. a keyref to ensure that all As reference a valid B. For 
the obvious s/w engineering reasons I would like the alternative schema 
to be based on the original (not copied) so I feel I should be using 
redefine. I can't make this work, feel I am swimming against a stream 
and therefore assume that I have got it all wrong somewhere. Can I use 
redefine to add identity constraints? Should I be going about this some 
other way?

Nigel

  <xs:element name="List">

    <xs:complexType mixed="false">

      <xs:sequence>

        <xs:element ref="A"      minOccurs="0" maxOccurs="unbounded"/>

        <xs:element ref="B"      minOccurs="0" maxOccurs="unbounded"/>

      </xs:sequence>

    </xs:complexType>

    <xs:key name="BKey">

      <xs:selector xpath="B"/>

      <xs:field xpath="BID"/>

    </xs:key>

  </xs:element>

---------------------------------------------------------------------
Nigel Hardy     Tel: +44 1970 622 434.   http://users.aber.ac.uk/nwh/
  Dept. Computer Sci,  University of Wales, Aberystwyth, SY23 3DB, UK
  Adran Cyfrifiadureg, Prifysgol Cymru,     Aberystwyth, SY23 3DB, UK
Received on Monday, 2 June 2003 09:42:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:11 UTC