Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
e.g.
QUES 2: IS there any other way to register for a particular element (e.g Item) so that I get a call back only when 'Item' is encountered ?<Orders> <Order ID="0008" Date="11/14/1999"> <Item>A Book</Item> </Order> </Orders> -- $parser->setHandlers(Start => \&start_handler ); sub start_handler() { my ($p, $elmt ) = @_; if ( $elmt eq 'Item' ) { Ques - I want to get 'A Book' here. I want to call a new procedure with param(elmt, A book ) } }
So,in other words, can I define: $parser->setHandlers(Entity => \&entity_handler) and in entity_handler procedure I can get entity and value too. This does not seem to work.
thanks
jaya
Edit by dws to add <code> tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Parser start handler
by grantm (Parson) on Sep 27, 2002 at 04:31 UTC | |
|
Re: XML::Parser start handler
by mirod (Canon) on Sep 27, 2002 at 02:44 UTC | |
|
Re: XML::Parser start handler
by blm (Hermit) on Sep 27, 2002 at 01:27 UTC |