omegaweaponZ has asked for the wisdom of the Perl Monks concerning the following question:
So I can grab node1's value of "stuff I can get" without issue, but when I grab node2's value under "child node a", since both are called node2 and child node a, both ""stuff_I_want_1" and "stuff_I_want_2" come back together as one string and would return as "stuff_I_want_1stuff_I_want2" ....my code is:<parent_node> <node1><child_node>stuff_I_can_get</child_node></node1> <node2><child_node_a>stuff_I_want_1</child_node_a></node2> <node2><child_node_a>stuff_I_want_2</child_node_a></node2> </parent_node>
So I need a way to identify both nodes uniquely somehow even though they are called the exact same thing but have two different valuesforeach $test($dom->findnodes('/parent_node')) { $mystring = $test->findnodes('./node2/child_node_a'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Duplicate XML Node Question
by choroba (Cardinal) on Sep 18, 2014 at 17:14 UTC | |
by omegaweaponZ (Beadle) on Sep 18, 2014 at 17:38 UTC |