I don't know how to answer your question about ident="def" with a non
string, but I use ident="ref" type behavior inside collections all the
time. Also I'm using a custom (but very small) unmarshaller for this
task (the one François posted, but with all the marshalling code cut
out). Just by way of example here is a snippet of my binding. This
binding is for xml that references UiAttributes all over the document
including inside UiTables. UiTables also happen to be referenced later
so they also have and ident="def" field. As you can see I'm using the
unmarshaller="" instead of ident="ref", the reason is because JiBX
didn't support ident="ref" inside a collection back in March. This was
on the list of things for Dennis to look at for this release but I don’t
know if a fix made it in. You can find my thread on this issue if you
look in the list archives on March 18th.

        <mapping name="attribute" class="uimodel.UiAttribute">
                <value name="required" field="required"
usage="optional"/>
                <value name="readonly" field="readonly"
usage="optional"/>
                <value name="id" field="wiseAttribute" ident="def"/>
                <value name="type" field="type"/>
        </mapping>
        <mapping name="table" class="uimodel.UiTable">
                <value name="id" field="name" ident="def"/>
                <collection field="attributes" >
                        <structure name="attribute"
unmarshaller="util.RefUnmarshaller" usage="optional"/>
                </collection>
        </mapping>      


Mocky





-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eitan Suez
Sent: Monday, August 01, 2005 9:29 PM
To: JiBX Mailing List
Subject: [jibx-users] marshal by reference in a to-many situation..


hello,

  i have a followup question regarding marshalling references
  using the ident="ref" mechanism.

  the example in the tutorial uses a model with flights,
  and routes and carriers.  all relationships are 1-1.
  that is, a flight has a property called carrier and
  one can specify that this property be marshalled by 
  reference:
    <mapping name="flight" class="aero.Flight">
      <value name="carrier" field="_carrier" ident="ref" />
    </mapping>

  what about the case where i have a list of carriers in a collection
  and would like the collection's items to be marshalled by reference.
  how would i specify that in jibx?

thanks,
/ eitan



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to