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
    I have to use;
    use XML::XPath; use XML::XPath::XMLParser;

    Can it still be done?
      You tell me. I gave an XPath as requested.
        Is there any where you know I could find more information on how to use this technique //Info/Other[Type/text()="LN"]/Id on XML::Path?
        Thanks!