//Info/Other[Type/text()="LN"]/Id
use strict; use warnings; use XML::LibXML qw( ); my $root = XML::LibXML->new->parse_fh(*DATA)->documentElement(); for my $node ( $root->findnodes( '//Info/Other[Type/text()="LN"]/Id' ) ) { print($node->textContent(), "\n"); } __DATA__ <?xml version="1.0" encoding="ISO-8859-1"?> <OPEN> ... </OPEN>
WXY12345678 12345678XZW
Update: Added test code.
In reply to Re: Reaching Nodes Help with XML::XPath
by ikegami
in thread Reaching Nodes Help with XML::XPath
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |