W3C home > Mailing lists > Public > public-sml@w3.org > October 2007

[Bug 4995] Scoping of sml identity constraints (key, keyref, unique)

From: <bugzilla@wiggum.w3.org>
Date: Wed, 24 Oct 2007 05:36:11 +0000
CC:
To: public-sml@w3.org
Message-Id: <E1IkYuZ-0003mO-Cl@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4995





------- Comment #2 from kumarp@microsoft.com  2007-10-24 05:36 -------
I have added examples of id constraints with and without the proposed scope
attribute below. They are based on the discussion in the "Proposal for allowing
smlkeyref.doc" document.

Example that uses the proposed 'scope' attribute.
-------------------------------------------------

<element name="courses"> 
    <sequence> 
        <element name="students"/> 
        <element name="student" maxOccurs="unbounded">
           <sequence>
                  <element name="ID"/>
           </sequence>
        </element>
    </sequence> 
    <sml:keyref name="CourseStudents" refer="StudentIDisKeyRemote"
scope="deref(students)"> 
        <sml:selector xpath="course/student"/> 
        <sml:field xpath="ID"/> 
    </sml:keyref> 
</element> 


Example that achieves the intended goal without using the scope attribute.
--------------------------------------------------------------------------

<element name="courses"> 
    <sequence> 
        <element name="students"/> 
        <element name="student" maxOccurs="unbounded">
           <sequence>
                  <element name="ID"/>
           </sequence>
        </element>
    </sequence> 
    <sml:keyref name="CourseStudents" refer="StudentIDisKeyLocal"> 
        <sml:selector xpath="course/student"/> 
        <sml:field xpath="ID"/> 
    </sml:keyref>
    <sml:key name="StudentIDisKeyLocal" >
        <sml:selector xpath="deref(students)/student"/> 
        <sml:field xpath="ID"/> 
    </sml:key>
</element> 
Received on Wednesday, 24 October 2007 05:36:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:56:06 UTC