Solved

XPATH Limit number of results

Posted on 2006-11-29
2
2,161 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 125 total points
Comment Utility
Hi williamcampbell,
> [position () >= 10]

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

Cheers!
0
 
LVL 12

Author Comment

by:williamcampbell
Comment Utility
Doh!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now