[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Specifying Complex ID/Key/Unique reference Constraints Using XML schema

  • To: xml-dev@l...
  • Subject: Specifying Complex ID/Key/Unique reference Constraints Using XML schema
  • From: "=?gb2312?q?Michael=20T.?=" <yj_t@y...>
  • Date: Mon, 13 Oct 2003 20:15:01 +0800 (CST)

xml schema unique id
Hi All,
 
I'm new here, and I am looking for a solution to specify the following ID Constraint using XML schema:
 
Within the following xml:
 
<root>
    <groupA>
        <item id="a">
        <item id="b">
        <item id="c">
        <item id="d">
    </groupA>
 
    <groupB>
        <item id="e">
        <item id="f">
        <item id="g">
        <item id="h">
    </groupB>
 
    <groupC>
        <reference refs="a b d">  <!-- correct, referencing only items in "groupA" ! -->
        <reference refs="a d c e"> <!-- error, referencing not only items "groupA" but also in "groupB" ! -->
    <groupC>
</root>
 
As you can see from the comments, I would like to enforce a role that says:
the "refs" attribute in the "reference" element under the "groupC" element is a list of references, and they must reference the "id" attribute of the "item" element ONLY under the "groupA" element.
The biggest headache for me now is the "ONLY" thing, how to reflect this using XML schema? Could any one give me a hint? Thanks in Advance!
 
Regards,
Mike



Do You Yahoo!?
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.