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 Answer 1

1

Try:

"//Countries/Country[@Code = 'ZA' and @IsOut = '1']"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.