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

Re: conditional schemas

From: Eddie Robertsson <eddie@allette.com.au>
Date: Wed, 28 Nov 2001 20:43:39 +1100
Message-ID: <3C04B1CB.E204652A@allette.com.au>
To: Lieve Laporte <lieve.laporte@uz.kuleuven.ac.be>
CC: xmlschema-dev@w3.org
xml schema conditional tags
> <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?

Unfortunately you can't do this with W3C XML Schema. RELAX-NG can do this and
the other alternative is to use W3C XML Schema with embedded Schematron rules.
See my previous post [1] for an example of how to use embedded Schematron rules.

Cheers,
/Eddie

[1] http://lists.w3.org/Archives/Public/xmlschema-dev/2001Nov/0049.html
Received on Wednesday, 28 November 2001 04:36:18 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.