Xml.SelectSingle

Overview

Selects a single node by specified xpath.

Xml myXml.SelectSingle(xpath: string)

Selects a single node by specified xpath and executes callback function if node found.

Xml myXml.SelectSingle(xpath: string, callback: (node: Xml) => void)

Arguments

string xpath

Selects a single node by specified xpath.

(node: Xml) => void callback

Callback function to execute on selected node.

Remarks

If multiple nodes found on xpath, first node is selected.

Example

Basic usage

var customerNode = $Xml.SelectSingle('//Customer'); if (customerNode) { ... }

Example

Using callback function

$Xml.SelectSingle('//Customer', function(customer) { var customerId = customer.Evaluate('Id'); });

Copyright © 2010 - 2023 Emakin. All rights reserved.