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
--
View this message in context:
http://www.nabble.com/Element-occurs-more-than-once-%3A-%28-tp20856987p20856987.html
Sent from the Castor - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email