users@jaxb.java.net

RE: element substitution question

From: George Datuashvili <George.Datuashvili_at_Siebel.com>
Date: Mon, 5 Jan 2004 11:11:56 -0700

Instead of using paramE element can't you have an xs:choice of
idependantly defined single and multi elements?
(without deriving multi from single)

> -----Original Message-----
> From: Chuck H. Zhao [mailto:czhao_at_visionmonitor.com]
> Sent: Thursday, December 25, 2003 5:26 PM
> To: users_at_jaxb.dev.java.net
> Subject: element substitution question
>
> I have two elements like the following and would like to use element
> substitution:
>
> <single name="name1">foo</param>
>
> <multi name="name2">
> <val>foo</val>
> <val>bar</val>
> </multi>
>
> I defined the schema for base type param and <multi>:
>
> <xs:complexType name="param">
> <xs:attribute name="name" type="xs:string" use="required" />
> </xs:complexType>
>
> <xs:element name="paramE" type="param" abstract="true" />
>
> <xs:element name="multi" substitutionGroup="paramE">
> <xs:complexType>
> <xs:complexContent>
> <xs:extension base="param">
> <xs:sequence>
> <xs:element name="val" type="xs:string" minOccurs="0"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:element>
>
> Now how do I define <single> element as derived from the base
> type param? I only know to define <single> as extension of
> xs:string, but that won't work with substitutionGroup.
> I know I can always resort to do <single
> name="name1"><val>foo</val></param>, but I just hope I can do
> without the <val> here. Any ideas?
>
> -- Chuck
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net