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

RE: Two attributes should have same reference point/Two elements should have same reference point under the same root elment

From: Michael Kay <mike@saxonica.com>
Date: Fri, 18 Jan 2008 11:19:46 -0000
To: <saisuman@tataelxsi.co.in>
Cc: <xmlschema-dev@w3.org>
Message-ID: <00d301c859c4$08699b60$6501a8c0@turtle>
RE: Two attributes should have same reference point/Two elements should have same reference point under the same root elment

 
> 
> Hi jeni,

If you want to communicate with jeni then please write to her directly.
You're writing to a public list so I assume your message is addressed to
everyone.
> 
> case1:Please let me know the case where the two elements 
> under the same parent element have the same name and both 
> should refer to the same value.
> If the value of one element changed then the value of the 
> other element with same name should contain same value. 
> Because both should refer the same reference point.
> 
> case2:Two attributes under the same parent element shold 
> point the same value and both attributes should have the same value.
> If the value of the one attribute changed then the value of 
> the other attribute with same name should contain same value. 
> Same for this both should refer the same reference point.
> 

It's helpful to give examples of valid and invalid input, especially if you
use non-standard terminology like "point to" and "reference point".

It might be possible to achieve this requirement using key and keyref,
something like this:

<xs:key name="k1">
  <xs:selector xpath="@att1"/>
  <xs:field xpath="."/>
</xs:key>

<xs:key name="k2" refer="k1">
  <xs:selector xpath="@att2"/>
  <xs:field xpath="."/>
</xs:key>

Michael Kay
http://www.saxonica.com/
Received on Friday, 18 January 2008 11:20:08 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.