Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Choice of sub-element or character-data in an element

From: "Michael Kay" <mike@--------.--->
To: "'Arshad Noor'" <arshad.noor@----------.--->, <xmlschema-dev@--.--->
Date: 6/23/2008 11:06:00 AM
You can't do this directly in XML Schema 1.0. It would be better to use
different element names for the two cases - this would make life much easier
for users of the document.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Arshad Noor
> Sent: 22 June 2008 00:44
> To: xmlschema-dev@w...
> Subject: Choice of sub-element or character-data in an element
> 
> 
> How is it possible to define an XSD to allow an element to 
> either contain custom sub-elements, or a fixed string?
> 
> For example, I would like to be able to do the following:
> 
> <ElementA>
>     <ElementB>
>        <ElementC>Some value</ElementC>
>        <ElementD>Another value</ElementD>
>     </ElementB>
> </ElementA>
> 
> or
> 
> <ElementA>
>     <ElementB>Any</ElementB>
> </ElementA>
> 
> I'm not sure how to use <xsd:choice> to define this?  Thanks 
> for any suggestions.
> 
> Arshad Noor
> StrongAuth, Inc.
> 
> 


From mike@s... Mon Jun 23 09:09:54 2008
Received: from maggie.w3.org ([193.5


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