Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Converting a map to use tag names from keys?

Hi,

Is there an easy way to take a map and generate tagname/values from
them? I want to do the following:

Map<String, String> map = new HashMap<String, String>();
map.put("foo", "1");
map.put("bar", "2");

class Stuff {
  private Map<String, String> info;
}

I would like this to be:
<stuff>
  <info>
    <foo>1</foo>
    <bar>2</bar>
  </info>
</stuff>

So far it only seems that digging down and fiddling with the DOM but I
am really hoping to avoid that.


Thanks,
James


Back to the top