Re: alternative obligatory attributes

There is no straightforward way to do this that I know of.

Here is an outline of an approach.  I think it would work, but it won't 
help you if you have many such pairs of attributes on the same element.

Define a type for the element, TypeBase.  Make it abstract to force use 
of one of the derived types you are going to define.
Define an extension of TypeBase with the one attribute.
Define an extension of TypeBase with the other attribute.
Declare your element to be of TypeBase.
Use xsi:type in the instance to specify which of the derived types is 
being used.  OR, use a substitution group (but that will mean using 
global elements).

HTH,
Kevin

On 3/12/2009 1:06 PM, Klöck wrote:
>
> Hi,
>
> 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>
>
> Thank you for your interest.
>
>
> *Erwin Klöck*
>    Bayerische Landesbank
>    Geschäftsbereich Financial Office, IT and Operations
>    Organisation & Informatik
>    Team Banksteuerung Finance -4493-
>    Brienner Straße 24R/
> /   D-80333 München
>    Telefon: +49 89 / 2171-21420
>    Telefax: +49 89 / 2171-27546
>    _mailto:erwin.kloeck@bayernlb.de_
>    Internet: _http://www.bayernlb.de_
>
>    HRA München 76030; Sitz: München
>
>
>

Received on Thursday, 12 March 2009 17:41:45 UTC