?
Solved

XPATH Limit number of results

Posted on 2006-11-29
2
Medium Priority
?
2,386 Views
Last Modified: 2008-01-09

string l_search_string = @"//User[contains(translate(.,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),'" + l_search + "')]";
XmlNodeList l_list = l_doc.DocumentElement.SelectNodes(l_search_string);

I am doing a User Search and want to limit the number of result to say 10, is this possible using XPATH?

So if l_search is 'William' and there are 1000 williams I only want the frst 10

I tried adding [position () >= 10] but that does not give the desired result

I pass the result set to a DataList which displays results on a web page so i only want to display 10

Thanks

wc
0
Comment
Question by:williamcampbell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 18043590
Hi williamcampbell,
> [position () >= 10]

well, you need [position () <= 10]

Cheers!
0
 
LVL 12

Author Comment

by:williamcampbell
ID: 18045410
Doh!
0

Featured Post

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 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