users@jaxb.java.net

Re: Newb question regarding inheritance

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Thu, 23 Jul 2009 12:52:50 +0200

Try https://jaxb.dev.java.net/tutorial/ more specifically the section
Defining Subtypes

Although, the example you have posted isn't exactly inheritance in the OO
sense where the derived (sub-)type has all the fields of the base type, plus
additions.

-W


On 7/23/09, ofira shaer <oshaer_at_gmail.com> wrote:
>
> Hi.
>
>
> I am trying to understand how do I define an inheritance in XSD.
> For example, how do i define a base class
>
> BaseAction
> String actionName
> int actionLength
> List <Fields>
>
>
> and a derived class:
>
> DerivedAction
> actionName = "derivedName"
> actionLength = derivedLength
> List<DerivedFields>
>
> Should I use restriction/extenstion/substitusion group?
> I tried some options and it seems that the combination of extension and
> restriction is pretty complicated...
> I will be very thankful for any link or a general direction.
>
> Thanks.
> Ofira.
>