in reply to confirming key in xml?
The thing about XML::Simple is that it is sometimes just too simple (more e.g. here).
XML::LibXML + XPath solution:
use XML::LibXML; my $dom = XML::LibXML->load_xml(location=>'test.xml'); my @nodes = $dom->findnodes('/Settings/Channels/Channel[@Voltage]'); print @nodes ? "Found it!\n" : "Didn't Find it!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: confirming key in xml?
by ccherri (Acolyte) on Apr 07, 2015 at 16:41 UTC | |
by ccherri (Acolyte) on Apr 07, 2015 at 16:49 UTC | |
by Lotus1 (Vicar) on Apr 07, 2015 at 18:46 UTC |