Hi Werner,
thanks for your reply. So I'll be looking for some information about
namespaces,
just one thing: do I need to modify also the Unmarshalling code to use
namespaces
or it's just necessary to add namespaces to the XML ?
thanks a lot
John
Werner Guttmann wrote:
>
> 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
--
View this message in context:
http://www.nabble.com/Element-occurs-more-than-once-%3A-%28-tp20856987p20910834.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