Skip to content

SelectAll

Selects all matching nodes based on the specified XPath expression.

1
myXml.SelectAll(xpath: string):Array<Xml>

Selects all matching nodes based on the specified XPath expression and executes a callback function for each selected node.

1
myXml.SelectAll(xpath: string, callback: (node: Xml, i: number) => any):Array<any>

Parameters

string xpath
    The XPath expression to use for selecting nodes.

(node: Xml, i: number) => any callback
    A callback function to execute for each selected node. Optional. The callback function receives the selected node and its index as arguments.

Returns

An array of Xml objects representing the selected nodes. An array containing the results of the callback function for each selected node.

Remarks

Basic usage

1
var allCustomers = $Xml.SelectAll('//Customer');

Basic usage

1
2
3
$Xml.SelectAll('//Customer', function(customer) {
   var customerId = customer.Evaluate('Id');
});

Using callback function to map selected nodes

```javascript var customerIds = $Xml.SelectAll('//Customer', function(customer) { return customer.Evaluate('Id'); });

See Also