Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top