Solved

Easy: OR'ing an XPath Query

Posted on 2004-10-13
1
183 Views
Last Modified: 2010-04-15
Is it valid to do something like

doc.SelectSingleNode("/MyDataSet/myNode[@attrib1="testing" OR @attrib2="testing2"]);

if so, is that the correct syntax?  
0
Comment
Question by:jjacksn
1 Comment
 
LVL 3

Accepted Solution

by:
a_goat earned 250 total points
ID: 12301245
You just use "or" like you did (might have to be lower case).  You can use single quotes too to make your string cleaner.

Here's an awesome XPath reference:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmrefxpathexamples.asp
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now