Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

XPATH Limit number of results

Posted on 2006-11-29
2
Medium Priority
?
2,413 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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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. 
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

971 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