Was recently discussed on XML-DEV, I think.

I think jaxen might be correct, in this case, but I'm not
100% certain.

Anyhow, I think it becomes

        /descendent-or-self::node/foo[4]

which will select the fourth <foo> within a block, where-ever
it may be.

Adding parents might help you:

        (//foo)[4]

        -bob



On Mon, 22 Jul 2002, James Strachan wrote:

> Any thoughts on this...?
> 
> James
> 
> From: "Shawn Bayern" <[EMAIL PROTECTED]>
> > Hi James,
> >
> > Hope things have been going well with you!
> >
> > I've got a bug to report in Jaxen; let me know if you're not the right
> > person for it.
> >
> > Jaxen seems to compute the context position (i.e., position())
> > incorrectly; it instead maps position() to a node's position under its
> > parent.  The easiest way to demonstrate the bug is with a document like
> > this:
> >
> >  <root>
> >   <levelOne>
> >    <levelTwo>1-1</levelTwo>
> >    <levelTwo>1-2</levelTwo>
> >   </levelOne>
> >   <levelOne>
> >    <levelTwo>2-1</levelTwo>
> >    <levelTwo>2-2</levelTwo>
> >    <levelTwo>2-3</levelTwo>
> >    <levelTwo>2-4</levelTwo>
> >   </levelOne>
> >  </root>
> >
> > and an expression like this:
> >
> >   //levelTwo[position()=4]
> >
> > I believe the correct result is "2-2", but Jaxen 1.0 FCS yields "2-4" (as
> > the latter is the content of the first <levelTwo> element it finds with a
> > position of 4 under its parent, rather than the fourth in the set of nodes
> > selected by the base expression //levelTwo).
> >
> > Hope this helps.
> >
> > Shawn
> >
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.comm
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Jaxen-interest mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jaxen-interest
> 

--
Bob McWhirter        [EMAIL PROTECTED]
The Werken Company   http://werken.com/



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to