Thursday, June 24, 2010

XML to HashMap in JAVA

Hi Guys,

This program will convert any XML document to a HashMap in Java.
Download - Please download it from here-
http://code.google.com/a/eclipselabs.org/p/java-utility/downloads/list

1) Program 1: XMLToMap.java
This is the main java program. It has public static void main method.
2) Program 2: ValueHandler.java
This is the program which will actually do the conversion.
3) Prgram 3: StringToSteam.java
This is just a small util which will convert String to InputStream.

How to use?
1) Please unzip the zip file.
2) Copy all the 3 files in same folder
3) Run XMLToMap.java

The program will run on Java 1.5 and higher.

2 comments:

Suchita said...

I tried this program. It doesnt convert the simple type xml to hash map.

capsulesforthejavamind said...

Hi,

Do try the Conversion Conduit component

http://capsulesforthejavamind.blogspot.in/2014/10/conversion-conduit-v10_15.html