[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] longest xpath ever?



Do I win the award?   :)
 
j
 
 
 
$ cat j.pl
use XML::Twig;
my $twig=XML::Twig->new();
$twig->parsefile('j.xml');
my $root = $twig->root;
my @x = $root->get_xpath('soap:Body/AvailabilityResponse/AvailResponseSegments/a:AvailResponseSegment/a:RoomStayList/hc:RoomStay/hc:RatePlans/hc:RatePlan/hc:AdditionalDetails/hc:AdditionalDetail[@detailType="GuaranteePolicy"]/hc:AdditionalDetailDescription/hc:Text');
print $x[0]->text . "\n";
 
$ perl j.pl
Guarantee is mandatory to reserve room,AX,DC,DS,JC,MC,VI