SelectNodes Overview

SelectNodes allows you to keep only a subset of a given Node (Ex: “WorkData/Inquire”). This subset is taken by passing in an XPath input. So, the filter is done by XSLT Predicates. Predicates are used to find a specific node or a node that contains a specific value and are always embedded in square brackets.

The service selects all nodes specified in the XPath input, removes all the previous input for the node given, and then returns the ones it was told to select with the XPath input and XSLT Predicate. There is evidence of this in the logs because usually a service’s Info node comes after the results. However, if I pass in an XPath without an XSLT Predicate, it will just remove all the output and re-add it all back. The only difference is the order. The service info node will not occur first and then the results after.

Note that this same functionality can be recreated in another service called EvaluateXML, but it will need to be used in conjunction with XSLT. If you are familiar with XSLT, EvaluateXML is a more powerful tool because it can be further customized for any further needs without having to add a new service.

There is also another service called SelectNode which also allows you to take a subset of the given Node, but the subset is specified using indexes to specify their position in the result list.