P is for Practical | |
PerlMonks |
XML Node Values Based On Attributesby gpjahn (Novice) |
on Sep 29, 2022 at 18:24 UTC ( [id://11147151]=perlquestion: print w/replies, xml ) | Need Help?? |
gpjahn has asked for the wisdom of the Perl Monks concerning the following question: Hello, I've been playing with, and trying to learn, XML::LibXML. I've been trying to get the values from specific nodes based on one of its attributes. I can get and print "all" the node values, and I can get and print just the specific attribute values, but I can't seem to figure out how to print the node values of nodes with specific attributes. Here is the xml I'm using. I'd like to grab the values from the <Data> nodes, but only the ones with the "name" attribute that equals "NAME_2".
Here is the small bit of code that I'm using to pull out the contents of the attributes, but I don't know how to get the node values. I hope that makes sense. Thank you for your help!
Back to
Seekers of Perl Wisdom
|
|