in reply to XML::LibXML and namespaces
You can also give a relative path to the node in findvalue. The '.' means the current node so if "Time" is a child of the node at $node :
for my $node ($xml->findnodes('//y:Trackpoint')) { $time = $node->findvalue("./Time"); push @X,$time; }
If there are more than one "Time" nodes under $node then findvalue() will concatenate the text from all and return it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: XML::LibXML and namespaces
by Anonymous Monk on Nov 11, 2012 at 13:33 UTC | |
by Anonymous Monk on Aug 19, 2014 at 13:20 UTC | |
by Anonymous Monk on Oct 03, 2014 at 12:30 UTC | |
by Anonymous Monk on Oct 04, 2014 at 06:19 UTC | |
by seanc (Novice) on Oct 04, 2014 at 08:45 UTC | |
Re^2: XML::LibXML and namespaces
by Anonymous Monk on Nov 09, 2012 at 13:47 UTC | |
by Lotus1 (Vicar) on Nov 09, 2012 at 13:50 UTC | |
by Anonymous Monk on Nov 09, 2012 at 14:32 UTC |
In Section
Seekers of Perl Wisdom