users@jaxb.java.net

Re: Still no Substitution group support?

From: Ganga Sah <ganga_sah_at_yahoo.com>
Date: Thu, 05 Jun 2003 23:02:42 -0700

How about this:

<xs:schema ..>
<xs:ComplexType name="Animal">
  <xs:attribute name="name" type="xs:string"
use="required"/>
</xs:ComplexType>

<xs:ComplexType name="dogType">
  <xs:ComplexContent>
    <xs:extension base="Animal/>
    <!--add dog specific elements/attr-->
  </xs:ComplexContent>
</xs:ComplexType>

<xs:ComplexType name="catType">
  <xs:ComplexContent>
    <xs:extension base="Animal/>
    <!--add cat specific elements/attr-->
  </xs:ComplexContent>
</xs:ComplexType>

<xs:sequence>
  <xs:element name="dog" type="dogType"/>
  <xs:element name="cat" type="catType"/>
</xs:sequence>

</xs:schema>


--- Gary Gregory <ggregory_at_seagullsw.com> wrote:
> IOW, how do I do this:
>
> Snoopy.xml:
> <dog name="Snoopy"><!-- dog elements --></dog>
>
> Felix.xml:
> <cat name="Felix"><!-- cat elements --></cat>
>
> And get
>
> interface Dog extends Animal
> interface Cat extends Animal
> Animal implements get/setName()
>
> ?
>
> Thanks,
> Gary
>
>
> -----Original Message-----
> From: Gary Gregory
> Sent: Thursday, June 05, 2003 16:13
> To: 'Discussion list for the Java Architecture for
> XML Binding'
> Subject: Still no Substitution group support?
>
> Hello,
>
> From the 1.0 spec:
>
> "Substitution group
> Any XML Schema concepts indicating that substitution
> group support is
> a necessary component of the schema should be
> reported as an error."
>
> When will Substitution group be supported?
>
> Is my only alternative is to use a vendor extension
> to specify a common
> supertype?
>
> Thanks,
> Gary
>


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com