Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How do I add a 3rd condition to my vb.net code?

How do I add a 3rd condition to my vb.net code?

How do I add a 3rd condition to my vb.net code?

In the xml document below, I would like to check for 3 things

1. If Phone/@Current ='true'
2. If Type/@Word ='HOME'
3. If Invalid is not true

I have done 1 and 2 but I am not sure how to do 3 in the same line of code.

My xml document which is put into an object objxmlPhoneNode

CODE --> xml

<?xml version="1.0" encoding="UTF-8"?>
<Phone Op="A" Current="true">
	<Type Op="A" Word="HOME">Home</Type>
	<Number Op="A">444-081-7031</Number>

I have taken care of condition number 1 and 2. I need hep to add condition 3. i.e. If Invalid is not true.

CODE --> vb.net

objxmlPhoneNode = objXmlPartyNode.SelectSingleNode("Phone[@Current='true' and Type/@Word='HOME']") 

RE: How do I add a 3rd condition to my vb.net code?

Have you tried:

CODE --> XPath

"Phone[@Current='true' and Type/@Word='HOME' and Invalid != 'true']" 

Tom Morrison

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close