Great, it works!!!! Thanks for the help

My final mapping is 
        <class 
                name = "inform.orm.entity.Entity        auto-complete =
"false">
                <map-to xml="clientsummary"/>
                <field name="ClientNo" type="inform.orm.entity.ClientNo"
Container="true">
                 </field>
        </class>

        <class
                name = "inform.orm.entity.ClientNo"
auto-complete="false">

                <field name="ClientNo">
                        <bind-xml name="clientno" node="attribute"/>
</field>
        </class>


And it produced

<clientsummary clientno="ASH141">
</clientsummary>




> -----Original Message-----
> From: Keith Visco [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 1 February 2005 10:51 a.m.
> To: [email protected]
> Subject: Re: [castor-user] Moving a tag up the XML hierachy
> 
> 
> Hi Richard,
> 
> Oops, I didn't realize that the ClientNo also had another field named
> clientno.
> 
> Try removing the bind-xml element, it should produce better xml for
you:
> 
> <field name="ClientNo" type="ClientNo" container="true"/>
> 
> --Keith
> 
> Richard Schmidt wrote:
> > That produces the following
> >
> > <clientsummary clientno_="[EMAIL PROTECTED]">
> > </clientsummary>
> >
> > Looks as if the code is calling ClientNo.toString() method, which is
a
> > good idea, but not quiet what I want.
> >
> > I cannot find any info about the container attribute on Castor XML
> > Mapping page. How does it work? Is there any documentation?
> >
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: Keith Visco [mailto:[EMAIL PROTECTED]
> >>Sent: Tuesday, 1 February 2005 9:50 a.m.
> >>To: [email protected]
> >>Subject: Re: [castor-user] Moving a tag up the XML hierachy
> >>
> >>
> >>Yes, change your mapping to the following:
> >>
> >>    <field name="ClientNo" type="ClientNo" container="true">
> >>       <bind-xml name="clientno_" node="attribute"/>
> >>    </field>
> >>
> >>--Keith
> >>
> >>
> >>Richard Schmidt wrote:
> >>
> >>>Given the class (skipping out all the junk)
> >>>
> >>>Class Entity {
> >>>   Private ClientNo
> >>>
> >>>}
> >>>
> >>>class ClientNo{
> >>>   String clientno;
> >>>}
> >>>
> >>>and the following mapping
> >>>
> >>>   <class
> >>>           name = " Entity"
> >>>           auto-complete = "false">
> >>>           <map-to xml="clientsummary"/>
> >>>           <field name="ClientNo" type=" ClientNo">
> >>>                   <bind-xml name="clientno_" />
> >>>
> >>>           </field>
> >>>   </class>
> >>>
> >>>   <class
> >>>           name = " ClientNo"
> >>>           auto-complete="false">
> >>>
> >>>           <field name="ClientNo">
> >>>                   <bind-xml name="clientno" node="attribute" />
> >>></field>
> >>>   </class>
> >>>
> >>>Results in the following XML
> >>>
> >>><clientsummary>
> >>>    <clientno_ clientno="ASH141"/>
> >>></clientsummary>
> >>>
> >>>How can I change this to be
> >>>
> >>><clientsummary clientno="ASH141"/>
> >>></clientsummary>
> >>>
> >>>I.e. the field in ClientNo must appear as an attribute inside the
> >
> > higher
> >
> >>>XML tag.
> >>>
> >>>Thanks
> >>>Richard
> >>>
> >>>
> >>>
> >>>
> >>>We have moved!
> >>>>From Monday December 6th the Australian offices of ADERANT are in
> >
> > great
> >
> >>new premises in both Melbourne and Sydney.
> >>
> >>>Our new contact details are:
> >>>Level 8, 488 Bourke St, Melbourne, Tel +61 3 99937310 and Level 8,
> >
> > 74
> >
> >>Castlereagh St, Sydney, Tel +61 2 85071600
> >>
> >>>
> >
######################################################################
> >
> >>>Attention:
> >>>This e-mail message is privileged and confidential. If you are not
> >
> > the
> >
> >>>intended recipient please delete the message and notify the sender.
> >>>Any views or opinions presented are solely those of the author.
> >>>
> >>>
> >
> >
######################################################################
> >
> >>>
> >>>
> >>>
> >
------------------------------------------------------------------------
> >
> >>>-----------------------------------------------------------
> >>>If you wish to unsubscribe from this mailing, send mail to
> >>>[EMAIL PROTECTED] with a subject of:
> >>>        unsubscribe castor-user
> >>
> >>
> >>
> >>-----------------------------------------------------------
> >>If you wish to unsubscribe from this mailing, send mail to
> >>[EMAIL PROTECTED] with a subject of:
> >>        unsubscribe castor-user
> >
> > We have moved!
> >>From Monday December 6th the Australian offices of ADERANT are in
great
> new premises in both Melbourne and Sydney.
> > Our new contact details are:
> > Level 8, 488 Bourke St, Melbourne, Tel +61 3 99937310 and Level 8,
74
> Castlereagh St, Sydney, Tel +61 2 85071600
> >
> >
######################################################################
> > Attention:
> > This e-mail message is privileged and confidential. If you are not
the
> > intended recipient please delete the message and notify the sender.
> > Any views or opinions presented are solely those of the author.
> >
> >
######################################################################
> >
> >
> >
> >
------------------------------------------------------------------------
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >         unsubscribe castor-user
> 
> 
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user
We have moved!
>From Monday December 6th the Australian offices of ADERANT are in great new 
>premises in both Melbourne and Sydney.
Our new contact details are: 
Level 8, 488 Bourke St, Melbourne, Tel +61 3 99937310 and Level 8, 74 
Castlereagh St, Sydney, Tel +61 2 85071600

######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

######################################################################

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to