Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: elements type attribute question

From: Sandy Gao <sandygao@--.---.--->
To: "Natarajan Ravi" <Ravi.Natarajan@---.---.-->
Date: 2/3/2006 4:46:00 AM
Short answer: not allowed.

Medium answer: why? How do you determine which type to use?

Long answer: declare a base type, and derive all your choice types from 
that base. Use the base type in the element declaration. Use xsi:type in 
your instance to indicate which type to use for validation.

Thanks,
Sandy Gao
XML Parser Development, IBM Canada
(1-905) 413-3255
sandygao@c...


xmlschema-dev-request@w... wrote on 02/03/2006 03:53:17 AM:

> 
>     I would like have an element declaration whose "type" is a 
> choice (1..n) other complex types. <xs:element name="test" 
> type="ComplexType_1 | Complex_Type_2" />.  Effectively I would like 
> to dynamically decide type at declaration stage which is a choice.
> Regards
> 
> Ravi
> This e-mail is confidential and privileged. If you are not the 
> intended recipient please accept our apologies; please do not 
> disclose, copy or distribute information in this e-mail or take any 
> action in reliance on its contents: to do so is strictly prohibited 
> and may be unlawful. Please inform us that this message has gone 
> astray before deleting it. Thank you for your co-operation.


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