OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] property dependency checking

[ Lists Home | Date Index | Thread Index ]

Title: Message
I think Jeni Tennison actually found a neat trick for this once, but in the general case such cooccurrence constraints need to be specified in another schema language.  You can combine Schematron rules with XSD type definitions using appinfo annotations. Eddie Robertson wrote an excellent outline of this technique:
 
-----Original Message-----
From: Prasad G S K [mailto:prasadg@aztec.soft.net]
Sent: Thursday, April 10, 2003 8:02 AM
To: xml-dev
Subject: [xml-dev] property dependency checking

Hi,
Please go thru the xml documents below:
 
Case 1:
<root>
    <prop1 value="ABC">
    <prop2 value="...">
</root>
 
Case 2:
<root>
    <prop1 value="XYZ">
    <prop3 value="...">
</root>
 
I want to state my requirement as follows:
-> When the value of "prop1" is ABC then "prop2" should follow "prop1"
-> When the value of "prop1" is XYZ then "prop3" should follow "prop1"
 
Can I define this kind of restriction/dependency in XSD files? Or is the restriction too fine that it is to be handled within the application?
 
regards,
GSK




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS