Perl snippet:
my $xml = new XML::Simple(
KeyAttr=>{
property => 'propertyname',
},
ForceArray => 1,
ContentKey => '-content');
my $config = $xml->XMLin($configFile);
Configfile looks like:
<config>
<property propertyname="text1" b="text2" c="text3" d="text4">
text5
</property>
<property propertyname="text6" b="text7" c="text8" d="text9">
text10
</property>
</config>
How do I parse this config file so that c
becomes a key and I can access the corresponding b
and d
? What does KeyAttr
do?