Hi!
I have a problem with a nested collection (properties) for which I
want to use the top-level defined mapping (property):
My mapping :
-------------------------------------------------------------------------------
<mapping class="cirano.gnp.auctioneer.core.NegotiationState"
name="negotiation-state">
<value name="nego-gpk" field="negoGPK" style="attribute"/>
...
<collection field="quoteLineItems" type="java.util.HashSet">
<structure name="quote-line-items"
type="cirano.gnp.auctioneer.core.QuoteLineItem">
<value name="product-gpk" field="productGPK" style="element"/>
<collection name="properties" field="properties"
type="java.util.HashSet"
item-type="cirano.gnp.auctioneer.core.Property" usage="optional"/>
</structure>
</collection>
</mapping>
<mapping class="cirano.gnp.auctioneer.core.Property" name="property">
<value name="name" field="name" style="attribute"/>
<value name="value" field="value" type="java.lang.Object"
get-method="getValue" set-method="setValue"
deserializer="cirano.gnp.util.JibxHelper.getObject"
style="attribute"/>
<value name="key" field="isKey" get-method="isKey"
set-method="setKey" style="attribute"/>
<structure field="range" type="cirano.gnp.auctioneer.core.Range"/>
<value name="level" field="level" style="attribute"/>
</mapping>
-------------------------------------------------------------------------------
My XML :
-------------------------------------------------------------------------------
<negotiation-state nego-gpk="2228224">
...
<quote-line-items>
<product-gpk>2228288</product-gpk>
<properties name="leader_price" value="1.0" key="false" level="0"/>
<properties name="leaderName" value="announcer" key="false" level="0"/>
<properties name="is_leader_price_moving" value="0" key="false" level="0"/>
</quote-line-items>
</negotiation-state>
-------------------------------------------------------------------------------
I get the error "Expected "quote-line-items" end tag, found
"properties" start tag (line 1, col 867)" ???
If a define the collection using a structure with all the attributes
it works, but I would like to use the top-level mapping since the
property mapping is used in many other places...
Please note that the original XML was generated by Castor and I have
to be backward compatible...
Thanks
Christian
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users