in reply to Reaching Nodes Help with XML::XPath
//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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reaching Nodes Help with XML::XPath
by Anonymous Monk on May 12, 2010 at 19:35 UTC | |
by ikegami (Patriarch) on May 12, 2010 at 19:39 UTC | |
by Anonymous Monk on May 13, 2010 at 12:14 UTC | |
by ikegami (Patriarch) on May 13, 2010 at 16:29 UTC |