I like to use castor with axis. It works quite nice, except serialization of (float) arrays. I have a class with two float[] members and want them to be serialized as lists of float values (<values> 1.0 2.04 0.23 ..</values>). My mapping file looks like this:
<class name="myorg.VsHeightMapGeometry">
<field name="heightMap" type="float" collection="array" container="true" direct="false" >
<bind-xml name="heights" node="element" />
</field>
..
</class>
When serializing the class the resulting xml looks like this: <ns1:geometry ... 217.1151.8137.3161.5187.6140.00.00.00.00.00.00</ns1:geometry>
Notice that a) the values are not separated with whitespace and b) the two arrays are treated as one
As a workaround a am using setting the container="false" in the mapping file. Unfortunatly it is not really suitable for big datasets, but it works and looks like this:
<ns1:geometry ... >
<heights xmlns="">
<float>217.1</float>
<float>...</float>
</heights>
<color xmlns="">
<float>0.1</float>
<float>...</float>
</color>
<ns1:geometry>
I pointed out this problem a while ago (see thread "marshaling float array to list"). It seems to be a bug in "container=true". Any news on that? Does someone knows how to fix it? I would try to fix it, but have not clue where to start...
- Torsten
PS: I used the CVS version from 07/30/04.
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
