xpath match first and last child
Clash Royale CLAN TAG #URR8PPP xpath match first and last child Trying to determine if any P tag text's is entirely within strong/B tags // Match (unacceptable, flag to user): <p><strong>Any text and <span>maybe</span> other <em>tags</em></strong></p> // Don't match (acceptable): <p>Any text and <strong>maybe</strong> other <em>tags</em></p> You can compare string(//p) and string(//p/strong) – gangabass Jul 23 at 2:36 string(//p) string(//p/strong) 4 Answers 4 p //p strong //p[.//strong] //p[.//strong[normalize-space(.) != ""]] and no text node descendant with content that has no strong ancestor node: strong //p[ .//strong[normalize-space(.) != ...