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

conditional schemas

From: Lieve Laporte <lieve.laporte@uz.kuleuven.ac.be>
Date: Wed, 28 Nov 2001 10:22:52 +0100
Message-ID: <002401c177ee$41558510$2d63a8c0@uz.kuleuven.ac.be>
To: <xmlschema-dev@w3.org>
conditional schemas
Hello,

Can anyone help me with the following:
I have two xml documents that are quite similar, except for the presence of
one particular tag. I would like to use the same schema to validate both
these documents. Is there a way to make a schema conditional? Can I in some
way express that for instance if the document contains attribute value "x",
that a certain tag should be present, and if the document contains attribute
value "y", that it cannot contain that same tag?

example:

<actions name="access">
    ...
    ==> the document has to contain tag <tag>
    ...
</actions>

<actions name="settings">
    ...
    ==> the document may not contain tag <tag>
    ...
</actions>

In this case, can I express in the schema that if the value of name is
access, the <tag> should be present, and if the value of name is settings,
it shouldn't?

Thanks a lot,
Lieve
Received on Wednesday, 28 November 2001 04:22:55 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.