Solved

Easy: OR'ing an XPath Query

Posted on 2004-10-13
1
188 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 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