Store XML values to a String in JAVA

catlinw

New Member
I want to store the values contained in an XML file to a java String Object. Here is my XML code :\[code\]<properties> <comment>test.xml</comment> <entry key="1">test1</entry> <entry key="2">test1,test2,test3</entry> <entry key="3">test1,test2,test3</entry><properties>\[/code\]I want 'values' to be stored in a string.Eg: \[code\]String msg;if(msg.equals("1")){ String str1 = //get values of key "1" (ie) test1}else if(msg.equals("2")){ String str2 = //get values of key "2" (ie) test1,test2,test3}\[/code\]Is there any way to do it using HashMap or anything?? Thanks.
 
Back
Top