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

Re[2]: <key> problems.

From: Kevin Burges <xmldude@burieddreams.com>
Date: Mon, 19 Nov 2001 14:32:02 +0000
Message-ID: <3712065744.20011119143202@burieddreams.com>
To: Jeni Tennison <jeni@jenitennison.com>
CC: ht@cogsci.ed.ac.uk, xmlschema-dev@w3.org

I've managed to solve the problem. I have control over the XML in
question (XSLT generated), so I have made all <Field> elements contain
attributes for both FieldID and FormID. This way I can have exactly
the keys I want and enforce both the correct uniqueness and
referential integrity. Thanks both for the help...

<IDs>
  <Form FormID="FORM_1">
    <Field FieldID="FIELD_1" FormID="FORM_1"/>
    <Field FieldID="FIELD_2" FormID="FORM_1"/>
  </Form>
  <Form FormID="FORM_2">
    <Field FieldID="FIELD_1" FormID="FORM_2"/>
  </Form>
</IDs>

  <xs:key name="...">
    <xs:selector xpath="Form/Field" />
    <xs:field xpath="@FormID" />
    <xs:field xpath="@FieldID" />
  </xs:key>
 

-- 
groovy baby,
 Kevin                            mailto:xmldude@burieddreams.com

+++++++++++++ Cool music - http://mp3.com/marshan
++ Attitude Rock Webzine - http://burieddreams.com/attitude
Received on Monday, 19 November 2001 09:32:29 GMT

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