you should be able to do stuff like this pretty easily with digester. you haven't specified the object's your mapping to but you should be able use matches like "*/menu" to handle the recursion. ("*/menu" maps all menus elements no matter how deeply
- robert
On Thursday, February 27, 2003, at 04:16 PM, Pablo Nussembaum wrote:
hi Robert, I need to parse xml to build a MenuBar. The xml is:
<menubar id="wpPostal"> <menu id="Operator" text="Operator" mnemonic_key="O"> <menu id="id2" text="Wealth" mnemonic_key="N"> <menuitem id="initSuppliment" text="Suppliment" mnemonic_key="S"/> <menuitem id="initTakings" text="Takings" mnemonic_key="R"/> </menu> <menu id="ConsultsTitle" text="Consults" mnemonic_key="C"> <menu id="id14" text="Balance" mnemonic_key="L"> <menu id="id15" text="Card" mnemonic_key="C"> <menuitem id="initBalanceCA" text="Current_Account" mnemonic_key="C"/> <menuitem id="initBalanceSA" text="Savings" mnemonic_key="P"/> </menu> <menu id="id18" text="Typed" mnemonic_key="D"> <menuitem id="initDigCCBalance" text="Current_Account" mnemonic_key="C"/> <menuitem id="initDigSBalance" text="Savings" mnemonic_key="P"/> </menu> </menu> </menubar>
-----Mensaje original----- De: robert burrell donkin [mailto:[EMAIL PROTECTED] Enviado el: Jueves, 27 de Febrero de 2003 12:57 Para: Jakarta Commons Users List Asunto: Re: Digester w/ Recursive Tags
hi Pablo
i'm not sure that i really understand what you're driving at here. AFAIK
recursive tags can be processed pretty well already using (for example) the extended base rules. could you give a more detailed example of what you're having problems with?
- robert
On Thursday, February 27, 2003, at 02:42 PM, Pablo Nussembaum wrote:
I've the same problem, and I think to solve the problem we need to change the digesters rules to accept another rule (like a composite pattern)
An example will make my point more clear.
public void parse()
{
...
Digeter d = new Digester();
Rule r = new xxxxRule("a");
r.addXxxxRule("b");
d.addRule(r);
...
}
-- Pablo Nussembaum mailto: [EMAIL PROTECTED] Tel: +54-11-4382-6400 int 123 Datatransfer S.A.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]