Do you have the ability to start from an XML Schema, instead of an
object definition?  If you defined OtherNames as a complextype
containing a sequence of OtherName objects, that would match your XML,
and your generated code for OtherNames would contain a collection type
for the OtherName objects.  You wouldn't even need (necessarily) a
binding file. 

> -----Original Message-----
> From: bmg125 [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, March 03, 2007 2:18 PM
> To: [email protected]
> Subject: [castor-user] Help needed with Mapping and XML-Binding
> 
> 
> I am new to Castor and its mapping capabilities.   I  am 
> having a problem
> getting my XML wrappers to look the way I want it to when 
> using the xml-bind
> location attribute on a attribute node.    Basically, what I 
> have in my
> object is a List of strings (Names).
> 
> That I want represented in the XML as:
> 
> <OtherNames>
>         <OtherName Name="Bob" />
>         <OtherName Name="Steve" />
>         <OtherName Name="Chris" />
> <OtherNames>
> 
> What I am gettings is:
> 
> <OtherNames>
>         <OtherName Name= " Bob Steve Chris "/> </OtherNames>
> 
> My mapping looks something like:
> 
> <field name="OtherNames" type="java.lang.String" 
> collection="arraylist" >
>        <bind-xml node="attribute" name="Name"
> location="OtherNames/OtherName"/>
> </ field >
> 
> Is there a way to do this in the mapping file?
> Thanks in advance. 
> --
> View this message in context: 
> http://www.nabble.com/Help-needed-with-Mapping-and-XML-Binding
-tf3340401.html#a9290361
> Sent from the Castor - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to