• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass a java.util.HashMap in an XML

 
Merrin Thomas
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell how a Hash map can be reperesented in a XML file and read it.
Expecting a reply,

Merrin.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You would need to represent a list of key/value pairs, which is easy if the keys and values are simple types. If they are complex types, things get trickier. If nothing suggests itself to you, you could use a java.beans.XMLEncoder, and see what kind of XML that generates from your data.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic