Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: position() in XPath query >Thread Next - Re: position() in XPath query Re: position() in XPath queryTo: NULL Date: 10/2/2007 9:57:00 AM Hi Dimitre, Thanks a lot! Now the code works like a charm. BTW Could you explain (or point to a resource) what's the differenece between //name[position() > 10] and (//name)[position() > 10] ? The former one (with brackets) works perfectly - but why? Leszek "Dimitre Novatchev" <dimitren@t...> wrote in message news:46fdd7b9$0$47125$892e7fe2@a...... > > "TarTar" <spam.spam@l...> wrote in message > news:u302wEeAIHA.4592@T...... >> Hello, >> >> Is there a way to use the position() function in the XPath query issued >> by the Select method of XPathNavigator? >> >> I have the code: >> XPathDocument doc = new XPathDocument("data.xml"); >> XPathNavigator nav = doc.CreateNavigator(); >> XPathNodeIterator nodes = nav.Select("//name[positon() > 10]"); >> >> I would like to obtain all names which positions are greater than 10. >> Currently this piece of code generates the error: >> "Namespace Manager or XsltContext needed. This query has a prefix, >> variable, or user-defined function." >> >> How to solve this problem? > > I think there are at least two problems: > > 1. There is no positon() function in XPath. Probably you meant position() > > 2. Most probably the node-set selected by: > > //name[position() > 10] > > is not what you want. Try the following XPath expression: > > (//name)[position() > 10] > > > Cheers, > Dimitre Novatchev > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
