in reply to Bug in XML::Parser
Here's how I'd use XML::LibXML for that same simple example (to print out just the contents of "Amount" tags):
It doesn't get much simpler than that!#!/usr/bin/perl use strict; use warnings; use XML::LibXML; my $parser = XML::LibXML->new; my $doc = $parser->parse_file( "org1.xml" ); my $xpath = XML::LibXML::XPathContext->new( $doc ); for my $node ( $xpath->findnodes( '//Amount' )) { print $node->textContent, "\n"; }
|
|---|