note
tmharish
<p>
You can use <a href="http://search.cpan.org/~tmharish/XML-Smart-1.73/lib/XML/Smart.pm">XML::Smart</a> to do this like so:
</p>
<code>
my $xml_obj = new XML::Smart( $xml ) ;
my $hash_when_cat_eq_special = ( $xml_obj->{list}{value}( 'category', 'eq', 'special' )->pointer() );
</code>
<code>
$hash_when_cat_eq_special will contain:
{
"/nodes" => { parameter => 1 },
"/order" => ["category", "parameter"],
"category" => "special",
"parameter" => {
"/order" => ["instance", "CONTENT"],
"CONTENT" => "\n nameofparameter1\n ",
"instance" => 0,
},
}
</code>
<p>
Of course you can get more specific as follows:
</p>
<code>
my $xml_obj = new XML::Smart( $xml ) ;
my $param_contents = $xml_obj->{list}{value}( 'category', 'eq', 'special' )->{parameter}->content();
</code>
<code>
$param_contents will contain:
"nameofparameter1"
</code>
1016275
1016275