[Home] [By Thread] [By Date] [Recent Entries]
On 25/11/2019 19:39, Costello, Roger L. costello@xxxxxxxxx wrote: [snip] That is, my XPath query does not account for the requirement that the long series of paragraph elements be uninterrupted. How to writepreceding-sibling() count *any* preceding sibling, not contiguous preceding siblings I think you need to locate the closest preceding element that is *not* empty of text, and the count the elements between that and your context element, eg: count(preceding-sibling::p[.!=' '][1]
/following-sibling::p[.=' '])That should return 24 for your first example and 9 for the second. P
|

Cart



