Richard Tobin a écrit :

> In article <(E-Mail Removed). com>,

> piramido <(E-Mail Removed)> wrote:

>

>> and I'd like to reference the c-element with content B, i.e. the

>> second c-element in the file. But when I execute a/b/c[2], I get the c-

>> element with content E (the fifth one). Can somebody give me a hint in

>> what is wrong with this expression. In my opinion, at first a/b/c is

>> evaluated, which give a set of 7 nodes (7 c-element). Out of this set

>> the second node is taken, which would be the c-element with content B.

>

> That's not how it works. You don't get the second node of a/b/c;

> you get the c[2] of a/b. Only the fourth a/b has a c[2], and that's

> the one you get.
and a/b/c[1] will give you the 4 c elements that contain A B C D : you

evaluate a step upon the result of the previous one ; but as Richard

shows you, () are used for grouping

>

> (a/b/c)[2] will select the right element.

>

> -- Richard
--

Cordialement,

///

(. .)

--------ooO--(_)--Ooo--------

| Philippe Poulard |

-----------------------------

http://reflex.gforge.inria.fr/
Have the RefleX !