I\'m trying to select some content between two HTML comments, but having some trouble getting it right (as seen in \"XPath to select between two HTML comments?\"). There seems t
If you are interested in the first pair of comments, you could start with looking for the first comment:
//comment()[.=' begin content ']/following::*[not(preceding::comment()[.=' end content '])]
I.e.:
//comment()[1][.=' begin content '] <-- look for first suitable comment
/following::* <-- take all following nodes
[not(preceding::comment()[.=' end content '])] <-- satisfying condition there is no preceding "end comment"