I think that what you are looking for is the start_tag_handlers option, which lets you call a handler as soon as the start tag of an element has been parsed.
In the handler you can die (provided the call to parse is wrapped in an eval) or do whatever you want, including setting regular handlers.
In reply to Re: accessing root tags when using XML::Twig and twig_roots
by mirod
in thread accessing root tags when using XML::Twig and twig_roots
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |