in reply to Re^4: Xpath value query
in thread Xpath value query
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Xpath value query
by SDwerner (Initiate) on Sep 18, 2015 at 17:08 UTC | |
by poj (Abbot) on Sep 18, 2015 at 18:03 UTC | |
by SDwerner (Initiate) on Sep 18, 2015 at 18:44 UTC | |
by poj (Abbot) on Sep 18, 2015 at 18:58 UTC | |
by SDwerner (Initiate) on Sep 19, 2015 at 14:11 UTC | |
| |
by SDwerner (Initiate) on Sep 19, 2015 at 13:14 UTC | |
by Anonymous Monk on Sep 18, 2015 at 22:00 UTC | |
|
Re^6: Xpath value query
by SDwerner (Initiate) on Sep 18, 2015 at 15:45 UTC |