XML-Twig - specify path using bot tag names and attributes (using v3.25)

Posted on Wed Jul 19 18:59:22 2006 by szabgab
specify path using bot tag names and attributes (using v3.25)
I would like to write something like this:
my $twig=XML::Twig->new( twig_handlers => { '/tag1[@att1="morgo"]/tag2[@att2="korgo"]' => \&process_key, }, );

that is, to define a path using both tag names and attribute values on several levels. (Sometimes 5-10 levels!)

I played a bit with Twig but as I can see providing attribute definition can only be done with one tag.

'tag2[@att2="korgo"]' => \&process_key,

Is this the situation or am I missing something?
How can I define such a detailed path?

Direct Responses: 2667 | 2801 | Write a response