Digester - DynamicDigester?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Digester - DynamicDigester?

I would like to configure some form of DynamicDigester to parse generic XML
that contains repeatable content into a List of Map.
Each repeating element means a new map, and the map is keyed on the pattern,
with the value being the digesting value.

So considering:


I would like to configure it with patterns "*/name" and "*/age" and also
with the pattern for the repeating element "*/record".

Then after digesting I would like a
List<Map<String, String>>


Can anyone help me with this?

Be aware that I want to digest different XML schemas with the same Digester,
but just register different patterns for the "items of interest" and the
marker for the repeating element.

So really, I am thinking a pattern to push onto the stack a new HashMap for
each repeat element, and then register patterns to put the Pattern as the
key and the result as the value.

Unfortunately I can't work out how to get the Pattern in a Rule firing...

Thanks for any help or advice!