Hi Chris,
Hi,

I'm trying to get to grips with XPath, and having some problems
understanding next-sibling and preceding-sibling.

Just for a simple example, querying:  untitled2/next-sibling::*
returns:
/untitled2/MetaData
/untitled2/mainColumnParagraphs
/untitled2/untitled
/untitled2/untitled0
/untitled2/untitled1

This is what I would expect (and it does) untitled2/child::* to return.

This result is perfectly good because you're querying to find a node called "untitled2" and under this node you're getting all the siblings
I would expect the next-sibling query to return the set of nodes on the
same level, and following, untitled2. So this would not include
untitled2 in the results.

What part of this have I got wrong?
If I have understood you're expecting the siblings of untitled2?
To do so, just do that:

/next-sibling::untitled2

HTH

CAPITAINE Harold


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to