commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "petra staub" <>
Subject Digester question (Hashtables...)
Date Thu, 04 Sep 2003 09:23:09 GMT

i have following little problem:

How can I get following XML structure into some java entities?
my example.xml look about this:

<list name="list1">
  <element name="name1">value1</element>
  <element name="name2">value2</element>
  <element name="name3">value3</element>

<list name="list2">
  <element name="name4">value4</element>
  <element name="name5">value5</element>

<list name="list3">
  <element name="name6">value6</element>
  <element name="name7">value7</element>
  <element name="name8">value8</element>

I would like now to use digester to parse the XML file and
to generate a class where the list definitions are in hashtables,
something like:

MyClass.getList("list2") ---> Hashtable 

Concretely, my problem is, that i dont no how to preserve the
name of the list ("list1","list2","list3",...) until the end of reading/
parsing the <element> tags. Thus, is can create an hashtable
with all the <element> tags but when I want to call a setter method
for the hashtable (something like 
I dont have the list name (in the example "list1")...

I tried to push/pop values from the stack, but cant see through  it....just
doesn't work...

I think, this isn't really a problem, just my limited understanding of the

Can someone give me a hint?

Thank a lot!!!

MSN Groups & Chat - Freunde finden - leicht gemacht

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message