in reply to Help debugging xpath in Perl

It seems XML::Twig doesn't understand /text(). But maybe you don't need it? This seems to work:
'//*[@name="FilterName"]/*' => sub {print $_->text}

If you want to use the full XPath, switch to XML::LibXML. For large files, you can use its XML::LibXML::Reader. To experiment with XPath, you can use XML::XSH2, which is like xmllint combined with Perl.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Help debugging xpath in Perl
by tweetiepooh (Hermit) on Mar 17, 2021 at 09:34 UTC
    Super, that cracked it. Many thanks. Now to pull all the little bits of data together.