Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: alternative obligatory attributes

From: Kevin Braun <kbraun@-------.--->
To: Erwin <Erwin.Kloeck@--------.-->
Date: 3/12/2009 9:40:00 AM
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@b...
>    Internet: _http://www.bayernlb.de_
>
>    HRA München 76030; Sitz: München
>
>
>

From gkholman@C... Thu Mar 12 18:00:32 2009
Received: from bart.w3.org ([128.3


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent