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 UTC