Consider following XML document fragment:
<Book>
<Title>Example</Title>
<Content>
Some line
</Content>
<TOC>
Again some line
</TOC>
</Book>
Consider following Xpath expression:
*[not(self)::TOC]
What would be result of if current node is Book?
I think
*[not(self)::TOC]is not syntactically correct so you would get a syntax error.You might want
*[not(self::TOC)]instead which would select all child elements of theBookelement that are notTOCelements so in your sample theTitleelement and theContentelement.