Hi John,
Unless you start using namespaces, I am afraid the answer is no.
Werner
joshua1970 wrote:
> Hi all !
> I have to unmarshal the following XML:
>
> <sql-result>
> <username name="thomas" id="754" />
> <username name="fred" id="755" />
> </sql-result>
>
> Unfortunately Castor issues the following error:
> org.exolab.castor.xml.MarshalException: element "username" occurs more than
> once. (parent class: it.netcentrex.SqlResult)
>
> Here's how I have mapped the classes: the class UserName extends the class
> SqlResult:
>
> <class name="it.netcentrex.SqlResult">
> <field name="username"
> type="it.netcentrex.Username">
> <bind-xml name="username" />
> </field>
> ...
> </class>
>
> <class name="it.netcentrex.Username"
> extends="it.netcentrex.SqlResult">
> <map-to xml="username" />
>
> <field name="id" type="java.lang.String">
> <bind-xml name="id" node="attribute" />
> </field>
> <field name="name" type="java.lang.String">
> <bind-xml name="name" node="attribute" />
> </field>
> </class>
>
> Is it possible to have multiple elements of username mapped by Castor ? how
> can I do it
> thanks a lot
> John
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email