views:

96

answers:

1

My castor masrshaller have an XML output as below

root> field1 /field1> field2 /field2> ..........

fieldn> collection> field> field> .......... field> /collection> /root>

my mapping for the collection part is field name="collectionObj" type="string" collection="arraylist"> bind-xml name="field" location="collection" node="element" /> /field>

The issue is when the I will always have the collectiObj is empty whole collection>tag disappears from the XMl output. Instead I would like to display as collection/>. Is there a way other than writing some fieldhandler, say setting some property to handle this issue.

A: 

Couldn't find any alternative other than a custom field handler.. It is working fine...

Java Guy