DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Pass XML file contents to a hash table. (http://www.daniweb.com/forums/thread10319.html)

Cockney Sep 4th, 2004 3:56 pm
Pass XML file contents to a hash table.
 
Hi all

new in this forum

I'm facing a problem. I need to pass the contents of an XML file to a hash table. The problem is that for each key i have multiple values.

i.e.
<?xml version="1.0" encoding="utf-8" ?>
<Menu>
<File>
<EN>...</EN>
<FR>...</FR>
<IT>...</IT>
</File>
<ShowHide>
<EN>...</EN>
<FR>...</FR>
<IT>...</IT>
</ShowHide>
</Menu>

So far I have managed to read the xml file and and printout the selected key and value.
using something like:
getString("File","EN")

But now i want to place all the elements of the xml file to a hash table so that the programme reads the file faster (it's a big file).

Any ideas?

I'm guessing that i have to do something like:

Hashtable mytable = new Hashtable();
mytable.put(key,value);


but how do i separate each same key for a different value (EN,FR,IT) ?

Thanks in advance for your reply

P.S. I'm not a guru in this , so keep your answers as simple as possible, cheers.


All times are GMT -4. The time now is 7:39 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC