XML::Twig has this note against get_xpath
XML::Twig does not provide natively full XPATH support, but you can use XML::Twig::XPath to get findnodes to use XML::XPath as the XPath engine, with full coverage of the spec.so try this
Outputs : 459JQ#!perl use strict; use XML::Twig::XPath; my $twig = XML::Twig::XPath->new(); $twig->parsefile('txlife.xml'); my $root = $twig->root; my $xpath = q!//Party[@id=//Relation[child::RelationRoleCode[@tc='37'] +]/@RelatedObjectID]/Producer/CarrierAppointment/CompanyProducerID!; my @nodes = $root->findnodes($xpath); for (@nodes){ print $_->text; }
In reply to Re^5: Xpath value query
by poj
in thread Xpath value query
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |