Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - position() in XPath query >Thread Next - Re: position() in XPath query Re: position() in XPath queryTo: NULL Date: 9/28/2007 9:43:00 PM "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 | |||
|
