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

Re: alternative obligatory attributes

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Thu, 12 Mar 2009 13:59:41 -0400
Message-Id: <7.0.1.0.2.20090312135659.026438c0@wheresmymailserver.com>
To: <xmlschema-dev@w3.org>
Re: alternative obligatory attributes
At 2009-03-12 18:06 +0100, Klöck, Erwin wrote:
>is it possible to define alternative obligatory 
>attributes for an element? What I want is something like the following,
>where the element otto must have either of two 
>attributes but not both. If it is possible, how would one do this?
>
><top>
>         <file uri="xxxx"/>
>         <file relative-path="yyyy"/>
></top>

No, when using W3C Schema 1.0, because sibling 
elements of the same name cannot have different validation constraints.

Yes, when using W3C Schema 1.1 (using 
assertions), or ISO/IEC 19757-3 Schematron (using 
assertions) or ISO/IEC 19757-2 RELAX-NG (using a 
choice pattern on the attributes).

I hope this helps.

. . . . . . . . . . . . . Ken

--
XQuery/XSLT training in Prague, CZ 2009-03 http://www.xmlprague.cz
XQuery/XSLT/XSL-FO training in Los Angeles (New dates!) 2009-06-08
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
Received on Thursday, 12 March 2009 18:00:32 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.