H Wei, I share your expectation on the behaviour of your example. I know that the SchemaInstance type type has been an issue on the list a while ago. I'm not sure on the outcome. Have a look at the (2) archives. I avoided the use of xsi:type so far.
> Although I can not see how this information in the super > class is used, When a base is derived, might it not still be used underived? > -----Original Message----- > From: Wei Chiang [mailto:[EMAIL PROTECTED]] > Sent: Saturday, September 21, 2002 7:09 PM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] SourceGenerator: Class Descriptor > > > > H Wei (or is it Chiang), > > > Well, Wei is better :-) > > > An extension may not be part of the same namespace as it's base. The > > xmlName is certainly different, couse it is Y instead of X. I Hope > > that answer it. > > > > Although I can not see how this information in the super > class is used, I > accept that it could be useful during > marshalling/unmarshalling. Thanks for > the explanation. > > I would also like to bring up a question posted in an earlier > mail on a > different topic (JavaNaming). This time I'll ask the question > in a different > way: > > Suppose the xsd is: > > ... > <xsd:complexType name="top" abstract ="true"> > <xsd:sequence min occurs="0" maxOccurs="unbounded"> > <xsd:element name="text" type="xsd:string"> > <xsd:element name="price" type="xsd:decimal"> > </xsd:sequence> > </xsd:complexType> > > <xsd:complexType name="derived"> > <xsd:complexContent> > <xsd:extension base="top"> > <xsd:sequence min occurs="0" maxOccurs="unbounded"> > <xsd:element name="discount" type="xsd:decimal"> > </xsd:sequence> > </xsd:complexContent> > </xsd:complexType> > > <xsd:element name="Store"> > <xsd;complexType> > <xsd:sequence> > <xsd:element name="item" > maxOccurs="unbounded" type="top"> > </xsd:sequence> > </xsd:complexType> > </sxd:complexType> > > Suppose one xml based on the above xsd is: > ... > <Store ...> > <item xsi:type="derived"> > <text>BottleOfJellyBeans</text> > <price>1</text> > </item> > <item xsd:type="derived"> > <text>Jam</text> > <price>3</text> > <discount>0.20</discount> > </item> > </Store> > > I would expect that instances of "derived" class will be > instantiated when > the above xml is being unmarshalled. However, the unmarshal > code actually > instantiates a "top" class. Do I miss something here? > > Thanks, > Wei > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
