Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Enforcing IDs in XML Schema

From: "Simon Kampa" <simon.kampa@------.--.-->
To: <xmlschema-dev@--.--->
Date: 5/4/2004 5:19:00 PM
Hi,

Thanks for the tips so far.

However, I'm having difficulties getting that approach to =
work in a
scenario like this:

<items>
=09<item id="1">...</item>
=09<item id="2">...</item>
=09<item id="3">...</item>
</items>
<things>
=09<thing id="2">...</thing>
=09<thing id="3">...</thing>
=09<thing id="4">...</thing>
</things>

Within each section the IDs must be unique. But, the s=
ame ID can appear
again in a different section (e.g. in this example the =
ID values 2 and 3
appear twice).

Any ideas on how this would be expressed?

Thanks!

--
Simon Kampa

> -----Original Message-----
> From: Bob Schloss [mailto:rschloss@u...] 
> Sent: 03 May 2004 18:48
> To: Simon Kampa
> Cc: xmlschema-dev@w...
> Subject: Re: Enforcing IDs in XML Schema
> 
> 
> 
> 
> 
> 
> Simon,
> 
> 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 "key=
ref".
> 
> See section 5.2 "Keys and their references" in the W=
3C XML 
> Schema Part 0:
> Primer -
> http://www.w3.org/TR/xmlschema-0/#specifying%20Keys&theirRefs
> 
> Bob Schloss
> XML/XSL Transformational Systems - Extensible Technologies
> IBM Thomas J Watson Research Center
> Yorktown Heights, New York, USA
> http://www.research.ibm.com/people/s/bschloss
> 
> 
> 
> 
>                         =
                         =
             
>              
>              "Simon Kampa"      =
                         =
     
>              
>              <simon.kampa@stas     =
                         =
  
>              
>              ys.co.uk>        =
                         =
       
>           To 
>              Sent by:       =
           <xmlschema-dev@w...> 
>              
>              xmlschema-dev-req     =
                         =
  
>           cc 
>              uest@w...       =
                         =
      
>              
>                         =
                         =
             
>      Subject 
>                         =
               Enforcing IDs in XML =

> Schema         
>              04/30/2004 06:04     =
                         =
   
>              
>              AM          =
                         =
            
>              
>                         =
                         =
             
>              
>                         =
                         =
             
>              
>                         =
                         =
             
>              
>                         =
                         =
             
>              
> 
> 
> 
> 
> 
> 
> Hi,
> 
> I would like to use XML Schema to enforce something =
like the 
> following:
> 
> <definition id="12345">
>  ...
> </definition>
> 
> <use_definitions>
>   <def ref="12345"/>
>   ...
> </use_definitions>
> 
> 
> 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?
> 
> Thanks.
> 
> --
> Simon
> 
> ______________________________________________________________
> __________
> This email and any files transmitted with it are int=
ended 
> solely for the
> use of the individual or entity to whom they are a=
ddressed. 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.
> ______________________________________________________________
> __________
> 
> 
> 
> 
> ______________________________________________________________
> __________
> This email has been scanned for viruses on behalf of=
 STASYS Limited by
> the MessageLabs Email Security System.
> ______________________________________________________________
> __________
> 

________________________________________________________________________
This email and any files transmitted with it are intende=
d 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, pro=
fessional or other privilege. No mistake in transmission i=
s intended to waive or compromise any such privilege. If=
 you have received this email in error please notify t=
he sender at once.

This email has been scanned for viruses on behalf of S=
TASYS Limited by
the MessageLabs Email Security System.
________________________________________________________________________

From rschloss@u...  Tue 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent