Link to home
Start Free TrialLog in
Avatar of williamcampbell
williamcampbellFlag for United States of America

asked on

XPATH Limit number of results


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
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of williamcampbell

ASKER

Doh!