I am trying to populate a xml file from user's input values. User will give 2 entries a Key and a value. And i have a model class which is a as below:
public class Person
{ private HashMap<String, String> hash = new HashMap<String, String>();
public Person()
{ }
public Person(String key, String val)
{ hash.put(key, val); }
public String GetFirstName(String k)
{ return hash.get(k); }
}
How to make a xml from this object of the class? and how to retrieve a value from xml against a key?
And i want the xml like this:
<AllEntries>
<entry key="key1">value1</entry>
<entry key="key2">value2</entry>
<entry key="key3">value3</entry>
</AllEntries>
<person key="" value="" />
? We'll need a little more info. – Mcnamee