Hi Mathias, Auto-naming won't work if you specify 'name' at the same time, just remove your name attribute from the <bind-xml/> element.
Arnaud > -----Original Message----- > From: Matthias Peschel [mailto:M.Peschel@;intershop.de] > Sent: Wednesday, November 06, 2002 1:48 PM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] [xml] xsi:type handling in 0.9.3.9 and > 0.9.4 > > Hi Arnaud, > > it seems that I left out an important thing: > I have an ElementList class that contains a list of > PersistentElement > objects. The PersistentElement is the base class for a lot of other > classes. > So the only place where I could add a bind-xml mapping is the field > declaration "elements". But this doesn't work like you described. > > here are my mappings: > > <class name="ElementList"> > <map-to xml="ElementList"/> > <field name="elements" type="PersistentElement" > collection="vector"> > <bind-xml name="PersistentElement" node="element" > autonaming="deriveByClass"/> > </field> > </class> > <class name="PersistentElement"> > <map-to xml="PersistentElement"/> > </class> > <class name="ComponentReference" extends="PersistentElement"> > <map-to xml="ComponentReference"/> > ... some fields ... > </class> > ... other classes that derive from PersistentElement ... > > What I'm doing wrong? > > Thx > Matthias > > -----Original Message----- > From: Arnaud Blandin [mailto:blandin@;intalio.com] > Sent: Mittwoch, 6. November 2002 12:44 > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] [xml] xsi:type handling in 0.9.3.9 and > 0.9.4 > > > Hi Mathias, > > If you are using a Mapping you can add the following in the > definition > of the ComponentReference element: > <bind-xml autonaming="deriveByClass"/> > That should do the trick... > For more information on the <bind-xml> element, please take a look > at > http://www.castor.org/xml-mapping.html#3.5-The-<bind-xml>-element > > Hope that helps, > > Arnaud > > > > -----Original Message----- > From: Matthias Peschel [mailto:M.Peschel@;intershop.de] > Sent: Wednesday, November 06, 2002 12:28 PM > To: [EMAIL PROTECTED] > Subject: [castor-dev] [xml] xsi:type handling in 0.9.3.9 and 0.9.4 > > Hi, > > Until now we used Castor 0.9.3.9 and now we want to upgrade to > 0.9.4. > In the old version the marshalled xml looked like this: > > ��� <ComponentReference id="abc"/> > > In the 0.9.4 version it looks different: > > ��� <PersistentElement id="abc" xsi:type="ComponentReference"/> > > ComponentReference is�a concrete class that extends the abstract > class > PersistentElement. > I know, that the xsi:type attribute specifies the concrete sub class > of > the element. But in 0.9.3.9 the attribute�was only generated when > using > interfaces and not when using abstract classes. But > PersistentElement is > an abstract class. So it worked in 0.9.3.9. > > Did you extend the usage of ysi:type also for abstract classes? > Is there a way to get the same results as in 0.9.3.9? > > Many thanks. > > Matthias > > > ----------------------------------------------------------- > 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 ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
