Hi all,
I have question about Castor XML mapping.
Introduction:
public class Clazz {
private String str;
public String getStr() {...}
public void setStr(String str) {...}
}
Clazz mapping xml fragment:
<class name="Clazz">
<map-to xml="LEVEL-1"/>
<field name="str" type="java.lang.String">
<bind-xml name="str" node="element" location="LEVEL-2/LEVEL-3"/>
</field>
</class>
Problem:
When the str field isnot null, then the XML tree structure is correct for me:
<LEVEL-1><LEVEL-2><LEVEL-3><str>...</str></LEVEL-3></LEVEL-2></LEVEL-1>
But when the str field is null, then the structure is collapsed to:
<LEVEL-1/>
And I need to push Castor to this structure (and best of all is to do it with
mapping and without coding):
<LEVEL-1><LEVEL-2><LEVEL-3/></LEVEL-2></LEVEL-1>
How can I do this ???
Thanks a lot for the response.
Pat
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email