Xpath: decrypt this xpath?

what does this xpath mean? can anyone decrypt this?

//h1[following-sibling::*[1][self::b]] 
+6
xpath
source share
1 answer

Select each h1 element (in the node context document), immediately followed by the b element (without another intermediate element, although there may be intermediate text).

Destruction:

 //h1 

Select each h1 element that is a descendant of the node root of the document that contains the node context;

 [...] 

filter out any of these h1 elements that do not meet the following criteria:

 [following-sibling::*[1]...] 

so the first following sibling element passes this test:

 [self::b] 

self is an element of b . Literally, this last test means that when I start with the node context and select self (i.e. the node context) subject to the node test, which filters out everything except elements with the name b , the result is a nonempty set of node.

+22
source share

All Articles