vmallya has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I need to define a xml config file and read the parameters, attributes, values and assign them to a hash. I understood the part of XML::Simple and XMLin() to read the XML file, but I am having trouble in reading the elements based on attributes.
<list> <value category="default"> <parameter instance="0">nameoftheparameter</parameter> <value>1</value> </value> <value category="special"> <parameter instance="0">nameofparameter1</parameter> </value> </list>
I want to access the "value" based on the attribute "category" and also in case I have multiple parameters with different "instances". Please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML Parsing
by tobias_hofer (Friar) on Jan 31, 2013 at 10:21 UTC | |
|
Re: XML Parsing
by tmharish (Friar) on Jan 31, 2013 at 11:21 UTC | |
by Arunbear (Prior) on Jan 31, 2013 at 12:24 UTC | |
by choroba (Cardinal) on Jan 31, 2013 at 12:31 UTC | |
by Arunbear (Prior) on Jan 31, 2013 at 13:04 UTC | |
by vmallya (Initiate) on Jan 31, 2013 at 13:16 UTC | |
by tmharish (Friar) on Jan 31, 2013 at 14:12 UTC | |
by vmallya (Initiate) on Feb 08, 2013 at 14:14 UTC | |
by tmharish (Friar) on Feb 08, 2013 at 14:25 UTC | |
| |
|
Re: XML Parsing
by Anonymous Monk on Jan 31, 2013 at 10:21 UTC | |
|
Re: XML Parsing
by vmallya (Initiate) on Jan 31, 2013 at 13:09 UTC | |
by tmharish (Friar) on Jan 31, 2013 at 13:53 UTC |