Get node value using XML::XPath module in Perl Get node value using XML::XPath module in Perl xml xml

Get node value using XML::XPath module in Perl


getNodeValue is for attribute nodes. For elements, you want the string_value method:

foreach my $node ($nodeset->get_nodelist) {   print $node->string_value."\n";}


For your xpath, try /file1/table/tname/text()