This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Testing using XPath


Hi Stuart,

> How can I test from with the current node as element2, whether its parent's
> following-sibling[1] is element3?

When you test a node set then if there are any nodes in the node set
it returns true; if it's empty it returns false. The easiest test is
one that tries to select the immediately following sibling of the
current element's parent, but only if it's an element3 element.

Go to the parent with ..
Go to its immediately following sibling element with
following-sibling::*[1]
Only select it if it's an element3 element with the predicate
[self::element3]

Steps are separated by /s and predicates are placed at the end of the
step. So the path is:

  ../following-sibling::*[1][self::element3]

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]