XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
K ManojSubject: Validating XML through Schema
Author: K Manoj
Date: 11 Sep 2006 05:48 AM
Hi, I am having two elements A and B. I want to design schema to provide validation that user should enter value either A or B (one of them is mandatory). Could you suggest way to get this validation done. Regards Manoj

Postnext
Tony LavinioSubject: Validating XML through Schema
Author: Tony Lavinio
Date: 11 Sep 2006 08:57 AM
What you are looking for is called a "co-occurrence constraint".
Try searching on Google for references to
"co-occurrence constraints in xml schema" or asking on the
W3'c xmlschema-dev@lists.w3.org mailing list, which specializes
in these sorts of questions.

Posttop
K ManojSubject: Validating XML through Schema
Author: K Manoj
Date: 13 Sep 2006 08:03 AM
Hi, Thanks for the hint. You can add a constraint like this.

<xs:key name="dummy">
<xs:selector xpath="."/>
<xs:field xpath="isbn|title"/>
</xs:key>

So it will accept either isbn or title (one of them is mandatory) only.

Regards
Manoj

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

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