473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Xpath equivalent to select in for sql server??

What I am trying to do is filter on some attributes and I could have a
list of values, so instead of doing where attribute = value or
attribute = value, I am wondering if there is something equivalent to
the IN statement in sql, so attribute in (value1, value2) etc..

Thanks

Jul 21 '06 #1
2 1906


Shay1975 wrote:
What I am trying to do is filter on some attributes and I could have a
list of values, so instead of doing where attribute = value or
attribute = value, I am wondering if there is something equivalent to
the IN statement in sql, so attribute in (value1, value2) etc..
XPath 2.0 allows e.g.
attribute = ('value1', 'value2', 'value3')
but with XPath 1.0 (which .NET 1.x and 2.0 support) you have to use or
expressions
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 21 '06 #2
In XPath operator = works similar way when arguments are node-set.
So if you can express the set of your values as node-set you can use
operator = as 'IN'.
This is quite easy to do in XSLT you can produce such node-set from RTF or
from XML fragment imbedded into stylesheet as top level element.

Sergey

"Shay1975" <sh**************@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
What I am trying to do is filter on some attributes and I could have a
list of values, so instead of doing where attribute = value or
attribute = value, I am wondering if there is something equivalent to
the IN statement in sql, so attribute in (value1, value2) etc..

Thanks

Jul 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kj | last post by:
Suppose I have some XML document that contains tags of the form <... xmlns:foo="http://www.bar.org/foo"> <... xmlns:foo="baz"> <... xmlns:frobozz="http://www.bar.org/foo"> What's the...
2
by: Craig Buchanan | last post by:
I would like to use xml files as the datasource for a few vb.net classes that sit in the business tier. It would make sense to located this files in a subdirectory relative to the location of the...
1
by: Andy | last post by:
Hello Guys: I am having a little difficulty picking up how to perform an XPATH to get a single value for an XML file. <ICSMXML xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Header>...
4
by: Jim Garrison | last post by:
OxygenXML is rejecting the following usage with "Unknown system function: if" <xsl:variable name="qd" select="if(value/qDisplay/text() eq '') then 'empty' else 'right'"/> Is this...
0
by: Shay1975 | last post by:
What I am trying to do is filter on some attributes and I could have a list of values, so instead of doing where attribute = value or attribute = value, I am wondering if there is something...
2
by: Foxpointe | last post by:
I'm new to XPath so am sure my understanding is the issue here and could use some help.... I've got some fairly messy (X)HTML which has TD elements sprinkled in solely for the purposes of...
8
by: sehiser | last post by:
Hello, I've been reading up on xpath and I am able to access elements with it. I haven't been able to figure one thing out though. How would I use XPath to select an element where the text...
7
by: adurth | last post by:
Hi! I wanna copy all childnodes of the current nodes except those with basenames "name1" or "name2". Something like <xsl:copy-of select=" basename not equal ('name1' or 'name2') "/> Can...
1
by: Schmacker | last post by:
Hey there guys. I have a problem that I need some help with. I'm given a series of different XML files, and have to go through and pull out passages of text from said files. The passages are defined...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.