Hi
I would like to unmarshall my xml - xml from legacy system i have no way to
change, using castor and i have big problem with field appearing twice in my
mapping file.
In my xml i have something like this:
<shoppingCart>
<personalOrder>
<buyerSSID>
<ammount/>
</personalOrder>
<companyOrder>
<amount>
</companyOrder>
</shoppingCart>
My shopping cart has one property:
Order[] orders
where
order has following propertes:
buyerSSID
amount
So, for both company order and personal order elements i would like to
create Order object and then have it stored inside shoppingCart object.
In my mapping file i have:
<class name="ShoppingCart">
<field name="orders" type="Order" collection="array" >
<bind-xml name="personalOrder"></bind-xml>
</field>
<field name="orders" type="Order" collection="array" >
<bind-xml name="companyOrder"></bind-xml>
</field>
During unmarshalling i get en error that The field orders appears twice in
the descriptor ...
I realize that during marshalling Castor could have a real problem with my
mapping file but during unmarshalling everything should works: if engine
finds comapnyOrder or personalOder create order and then add it ...
Can anyone know if unmarshalling like can be done in Castor ??
Or Maybe someone knows any workaround.
I belive that gurus like Werner Guttmann can help me...
I can not change my classes and can not change my xml structure.
Thanks for a help.
Jakub Milkiewicz