hi

hi
>From what i knnow from my experiments with the
location attribute is that it will not work like the
way you have mentioned below.

I dont know what you exactly want to do with it 
but If you want 2 'Bar' elements under the same
'location' the best thing to do is to put them under a
'collection' and give them 'id' attributes to
distinguish them (if needed)

the mapping snippet should be something like this : 

<mapping>
�
 <class name="a">
<field name="bar" type="Bar" collection="array">
<bind-xml name="bar" location="abc/xyz" /> </field>
 </class> �
 </mapping>

Hope this helps.

The way you are trying to do it will not work as
Castor uses a SAX-driven parser.

and if my guess is right then your current mapping
might be generating --->
<a>
   <abc>
        <XYZ
                <BAR>...</BAR>
        </XYZ>
   </abc>
  <abc>
        <XYZ
                <BAR2>...</BAR2>
        </XYZ>
   </abc>
</a>

I am still quite a newbie user, so for a more
authorative answer on this one, wait till Keith
replies.

--- [EMAIL PROTECTED] wrote: 
> 
> > Hi,
> > 
> > I am new to Castor,
> > Can you please elaborate on location attribute..
> > As per description in manual 
> >  The value of this  "location" attribute is the
> name of the wrapper
> > element. To use more than one wrapper element, the
> name is separated
> > by a forward-slash as such: <?xml version="1.0"?>
> >  <mapping> 
> > ...
> >  <class name="a"> 
> > <field name="bar" type="Bar"> 
> > <bind-xml name="bar" location="abc/xyz" />
> </field>
> >  </class> ...
> >  </mapping> 
> > 
> > Which will produce something,
> > 
> > <a>
> >   <abc>
> >     <XYZ>
> >             <BAR>...</BAR>
> >     </XYZ>
> >   </abc>
> > </a>
> > 
> > Now if I would like to add element in this
> existing tree, say my
> > mapping file looks like..
> > (where the node value which I need to insert in
> existing tree comes
> > form different class)
> >  <class name="a"> 
> > <field name="bar" type="Bar"> 
> > <bind-xml name="bar" location="abc/xyz" />
> </field>
> >  </class>
> >  <class name="b"> 
> > <field name="bar" type="Bar"> 
> > <bind-xml name="bar2" location="abc/xyz" />
> </field>
> >  </class>
> > 
> > Will it produce something like,
> > 
> > <a>
> >   <abc>
> >     <XYZ>
> >             <BAR>...</BAR>
> >             <BAR2>..</BAR>  
> >     </XYZ>
> >   </abc>
> > </a>
> > 
> >  Its not working......is anything wrong or can you
> elaborate on
> > location attribute more in this context
> > 
> > Please reply soon
> > 
> > Snehal
> > 
> > 
> > 
> 
> 
> MASTEK
> "Making a valuable difference"
> Mastek in NASSCOM's 'India Top 20' Software Service
> Exporters List.
> In the US, we're called MAJESCO
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Opinions expressed in this e-mail are those of the
> individual and not that of Mastek Limited, unless
> specifically indicated to that effect. Mastek
> Limited does not accept any responsibility or
> liability for it. This e-mail and attachments (if
> any) transmitted with it are confidential and/or
> privileged and solely for the use of the intended
> person or entity to which it is addressed. Any
> review, re-transmission, dissemination or other use
> of or taking of any action in reliance upon this
> information by persons or entities other than the
> intended recipient is prohibited. This e-mail and
> its attachments have been scanned for the presence
> of computer viruses. It is the responsibility of the
> recipient to run the virus check on e-mails and
> attachments before opening them. If you have
> received this e-mail in error, kindly delete this
> e-mail from all computers.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> >
-----------------------------------------------------------
> 
> If you wish to unsubscribe from this mailing, send
> mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user
>  

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html



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

Reply via email to