views:

76

answers:

1

I am trying to search for an xml node:

<Countries>
  <Country FullName="AFRIQUE DU SUD" Code="ZA" IsOut="1" />
  <Country FullName="ALLEMAGNE" Code="DE" IsOut="0" />
</Countries>

Selecting on the basis of CountryCode only:

xmlDoc.SelectSingleNode("//Countries/Country/@[Code='ZA']");

How do I also apply the condition so that I can check for CountryCode AND IsOut = 1?

xmlDoc.SelectSingleNode("//Countries/Country/@[Code='ZA',@IsOut='1'");

The above condition does not work!

+1  A: 

Try:

"//Countries/Country[@Code = 'ZA' and @IsOut = '1']"
Andomar