XPath.select(options)
Method Description |
Selects an array of nodes from an XML that match an XPath expression. |
Returns |
xml.Node[] |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
required |
XML node being queried. |
|
|
string |
required |
XPath expression used to query node. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/xml Module Script Samples.
In the following code sample, a single node is selected based on the xpath
and node
parameters. The type of node being selected is an XML document. The xpath parameter matches to the //book
expression to locate the node. For more general information about xpath, see XPath Tutorial.
//Add additional code
...
var bookNode = xml.XPath.select({
node : xmlDocument,
xpath : '//book'
});
...
//Add additional code