With this:
<p>Some variable length text <abbr>abc</abbr> and more text.</p>
<p><abbr>abc</abbr>Some variable length text.</p>
<p><abbr>abc</abbr>Some variable length text. <a href="somelink">blah</a></p>
I'm trying to build an Xpath that will find p elements that:
- Have a child
<abbr>with value of "abc", but that child has no intervening text between the parent and the child. - Does not have a child
<a>.
#1 means the first line should not match, because it has text between the parent <p> and the child <abbr>.
#2 means the third line should not match, because although there is a child <abbr> and no leading text, it also has a child <a>.
Thus, only the second line,
<p><abbr>abc</abbr>Some variable length text.</p>
should match: no leading text, and no child <a>.
I've played with an XPath testbed for an hour, and done quite a bit of searching, but haven't figured out how to handle both of those requirements, but especially #1.