Hi Mark,
this is currently not an option with Castor. But given the increasing
frequency of people asking for precisely this feature, I am more than
willing to look into this - given that there's input from the folks
requesting this.
Regards
Werner
On 30.11.2010 09:31, Mark Hoebeke wrote:
Hi,
I have been exploring Castor for some time now, but couldn't find an
answer to the issue I'm facing.
I need to dynamically generate element names from the keys of a HashMap.
For instance, if my map looks like :
{ 'color' => 'red', 'size' => 'xl', 'price' => 10.0 }
I'd like the XML fragment to look like :
<color>red</color>
<size>xl</size>
<price>10.0</price>
This looks like bad practice, but the actual values of the keys in the
map are constrained making it possible to define a schema against which
to validate the generated XML. Moreover, it is impractical to define
classes having fields for every possible key of the map. Hence the need
to try a dynamic element generation approach.
Any clues welcomed !
Mark
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email