Exclude named child nodes in XPath

To select all subnodes of a record, except for named exclusions, use the following XPath syntax:

/rootNodeName/*[not(self::excludeChildName1)]

or for multiple exclusions :

/rootNodeName/*[not(self::excludeChildName1)][not(self::excludeChildName2)]

This entry was posted in C# Snippets. Bookmark the permalink.

Comments are closed.