Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.9.5
-
Fix Version/s: None
-
Component/s: XML
-
Labels:None
-
Environment:Operating System: All
Platform: All
-
Bugzilla Id:1338
-
Number of attachments :
Description
Attributes with location always appears last ones in the marshalled XML
although they were defined in first place of mapping file.
Example:
<mapping>
<class name="Class">
<map-to xml="my-class" />
<field name="firstField" type="string">
<bind-xml name="first_field" location="foo" node="attribute" />
</field>
<field name="secondField" type="string">
<bind-xml name="second_field" node="element" />
</field>
</class>
</mapping>
[desired output]
<my-class>
<foo first_field="aValue" />
<second_filed>anotherValue</second_field>
</my-class>
[desired output]
<my-class>
<second_filed>anotherValue</second_field>
<foo first_field="aValue" /> <!-- must be the first !!! -->
</my-class>
PD: Keith, I known you're working in "virtual fields" and rewriting the code. I
hope this will fixed in next release.
Hi David,
The reason for this is to take advantage of any elements which may have the same
location attribute. I think the virtual-field related code should handle this
case since virtual fields will group all related locations together. Though I
don't know when I'll actually finish the code. I'll see if I can make any simple
changes to the current code to get the desired effect.
Thanks.