Solved

Easy: OR'ing an XPath Query

Posted on 2004-10-13
1
187 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

861 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