W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2008

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

From: Koray SAKIROGLU <koray.sakiroglu@gmail.com>
Date: Mon, 23 Jun 2008 10:35:09 +0200
Message-ID: <23e987b00806230135hd55f4ddt408baf10b8662d4a@mail.gmail.com>
To: "Arshad Noor" <arshad.noor@strongauth.com>
Cc: xmlschema-dev@w3.org
<xsd:element name="elementA">
  <xsd:complexType>
     <xsd:choice>


2008/6/22 Arshad Noor <arshad.noor@strongauth.com>:

>
> 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.
>
>
>
Received on Monday, 23 June 2008 15:20:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:47 UTC