Hi.
I can't manage to pattern match nested XML where the level of nesting is
unknown (I'm only assuming that this can be done). Consider the
following -
An XML file used to create menu items in a Swing UI. <menu> elements
can have an unlimited number of other <menu> elements. So for a menu
structure like Tools|Options|Email, the XML would be similar to:
<desktop>
<menus>
<menu> <-- Top Level Menu to be installed
on a JMenuBar
<name>Tools</name>
<menu> <-- Sub Menu installed under
"Tools"
<name>Options</name>
<menu> <-- Sub Menu installed under
"Options"
<name>Email</name>
</menu>
</menu>
<menu>
</menus>
</desktop>
I tried the pattern "desktop/menus/*/menu" but Digestor logged "No rules
found matching 'desktop/menus/menu'"/. Code is:
digester.addObjectCreate("desktop/menus/*/menu",
MenuInstaller.class);
digester.addCallMethod("desktop/menus/*/menu/name",
"setMenuName", 0);
I also tried:
desktop/menus/menu (This only captures the first menu (Tools), as
I expected)
desktop/menus/*menu
*/menu (getting dsperate!)
*menu (getting desperate!)
Can this actually be done? Any help greatly appreciated.
Thanks,
Gary.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]