Hi,

I haven't found a way to map an array directly in the XML file.

I would like to do something like this:

<binding>
  <!-- this works and map a single object in the XML file  -->
  <mapping class=" test.MyClass" name="item">
    <value name="field" field="field" />
  </mapping>

  <!-- I want to do something like this, but it doesn't work...  -->
  <collection item-type="test.MyClass" name="list"/>
</binding>

I want my XML file to look like :
<list> <!-- I don't care about the name here -->
  <item>
    <field>value1</field>
  </item>
  <item>
    <field>value2</field>
  </item>
  <item>
    <field>value3</field>
  </item>
</list>

and this maps in a Java array : test.MyClass[]

Anybody knows if this is possible?

Thanks,

Stephane

P.S.
I can create a wrapper class around the array like this (but it is not practical for me...):
<binding>
  <mapping class="test.WrapperClass" name="top_level">
    <collection name="list" field="list"/>
  </mapping>
</binding>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to