hello, i've this code
my xml file
how can i do, to obtains the value of the attibute type only for the tag information who have the attribute valeur equal to"Niveau" ?
Like this tag : <information valeur="Niveau" type="Bon">
it's possible ??
Thanks
Code:
#!/usr/bin/perl -w
use XML::XPath;
use XML::XPath::XMLParser;
my $xp = XML::XPath->new(filename => 'client.xml');
foreach my $row ($xp->findnodes('/root/client/nom')) {
my $code = $row->findvalue('information')->to_literal;
print $code."\n";
}
my xml file
with this code i've this output<?xml version="1.0" encoding="windows-1250"?>
<root value="x">
<entreprise>some text</entreprise>
<info></info>
<client>
<nom name="paul">
<information valeur="Niveau" type="Bon">xxx</information>
<information valeur="Solvable" type="Mauvais">zoooooooo</information>
</nom>
</client>
<client>
<nom name="albine">
<information valeur="Solvable" type="Bon">azer</information>
</nom>
</client>
<client>
<nom name="Terence">
<information valeur="Niveau" type="Tres bon"/>
<information valeur="Solvable" type="Bon"/>
<information valeur="Ancien" type="Oui"/>
</nom>
</client>
</root>
xxxzoooooooo
azer
how can i do, to obtains the value of the attibute type only for the tag information who have the attribute valeur equal to"Niveau" ?
Like this tag : <information valeur="Niveau" type="Bon">
it's possible ??
Thanks