Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Getting the XML node containing a search text...

by ramrod (Deacon)
on Oct 27, 2009 at 14:47 UTC ( #803447=note: print w/ replies, xml ) Need Help??


in reply to Getting the XML node containing a search text...

Using XML::LibXML this works for me
use strict; use XML::LibXML; #Parse XML my $template = 'xmlsample.xml'; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($template); #Search all text nodes for my $node ($doc->findnodes( '//text()' )) #Print xpaths if criteria matched {my $search = $node->nodeValue; if ($search =~ m/InsertSearchCriteriaHere/) {print $node->nodePath();} }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://803447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2016-06-30 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (392 votes). Check out past polls.