[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath expression
>I want to make a XPath expression that finds the 5 first nodes that have a >attribute "namn" thats equals "Tomas". Is it possible? > >I suppose it should be something like this: >//[@namn="Tomas"] [position()<6] Something like that! You forgot the * after //, but you also have the problem that position() will return the position of the node amongst its matching siblings, not amongst all the matching nodes. You need to parenthesize the first part of the expression to get the effect you want: (//*[@namn="Tomas"])[position()<6] -- Richard
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|