username_4567
username_4567

Reputation: 4923

About XPath Expression

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?

Upvotes: 0

Views: 94

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167716

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 the Book element that are not TOC elements so in your sample the Title element and the Content element.

Upvotes: 1

Related Questions