W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2004

Re: Enforcing IDs in XML Schema

From: Bob Schloss <rschloss@us.ibm.com>
Date: Mon, 3 May 2004 13:48:11 -0400
To: "Simon Kampa" <simon.kampa@stasys.co.uk>
Cc: xmlschema-dev@w3.org
Message-ID: <OF34461176.44D6B3E3-ON85256E89.006164E3-85256E89.0061CBA5@us.ibm.com>


If there is an element which is the parent element of both the
definition   element information items
and the
use_definition    element information items,
you could specify identity-definition constraints as part of the element
definition, specfically you could specify "key" and "keyref".

See section 5.2 "Keys and their references" in the W3C XML Schema Part 0:
Primer -

Bob Schloss
XML/XSL Transformational Systems - Extensible Technologies
IBM Thomas J Watson Research Center
Yorktown Heights, New York, USA

             "Simon Kampa"                                                 
             ys.co.uk>                                                  To 
             Sent by:                  <xmlschema-dev@w3.org>              
             xmlschema-dev-req                                          cc 
                                       Enforcing IDs in XML Schema         
             04/30/2004 06:04                                              


I would like to use XML Schema to enforce something like the following:

<definition id="12345">

  <def ref="12345"/>

So, if an ID is used as a reference in the <def> element, there HAS TO
BE a correpsonding <definition> element with the same ID. Is it possible
to do this in XML Schema? Ideas?



This email and any files transmitted with it are intended solely for the
use of the individual or entity to whom they are addressed. They may
contain sensitive and/or in confidence information that is covered by
legal, professional or other privilege. No mistake in transmission is
intended to waive or compromise any such privilege. If you have received
this email in error please notify the sender at once.

This email has been scanned for viruses on behalf of STASYS Limited by
the MessageLabs Email Security System.
Received on Monday, 3 May 2004 13:49:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:05 UTC