Integration Cloud 6.6.0 | Built-In Services | Built-In Services | queryXMLNode
 
queryXMLNode
Queries an XML node.
The fields parameter specifies how data is extracted from the node to produce an output variable. This output variable is called a "binding," because the fields parameter binds a certain part of the document to a particular output variable. At run time, this service must include at least one fields entry. The service must include at least one entry in fields. The result of each query you specify in fields is returned in a variable whose name and type you specify.
Input Parameters
node
The XML node that you want to query. This parameter supports the following types of input:
*com.wm.lang.xml.Node XML node that you want to query. An XML node can be produced by xmlStringToXMLNode or an XML content handler.
nsDecls
Document Optional. Namespaces associated with any namespace prefixes used element to specify elements in fields/query. Each entry in nsDecls represents a namespace prefix/URI pair, where a key name represents a prefix and the value of the key specifies the namespace URI.
For example, to define the URIs associated with two prefixes called GSX and TxMon, you would set nsDecls as follows:
fields
Document List Optional. Parameters describing how data is to be extracted from node. Each document in the list contains parameters for a single query, as follows:
Key
Description
name
String Name to assign to resulting value.
resultType
String Object type that the query is to yield. The following shows the allowed values for resultType.
Underlying Value
Corresponding Data Type
Object
Object
Object[]
Object List
Record
Document
Record[]
Document List
String
String
String[]
String List
String[][]
String Table
query
String Query identifying the data to be extracted from node.
queryType
String Query language in which query is expressed. Valid values are WQL and XQL.
onnull
String Code indicating what you want queryXMLNode to do when the result is null. Set to one of the following:
*continue to indicate that all result values are acceptable for this query (including null).
*fail to indicate that the service should fail if the result of this query is null and continue in all other cases.
*succeed to indicate that the service should continue if the result of this query is null and fail in all other cases.
fields[]
Document List Parameters that support recursive execution of bindings. Each fields list defines bindings for one level of the output with the top level being the pipeline and the first level down being contents of a document or document list in the pipeline.
Output Parameters
Document Results from the queries specified in fields. This service returns one element for each query specified in fields. The specific names and types of the returned elements are determined by the fields/name and field/resultType parameters of the individual queries.
Usage Notes
If queryXMLNode fails, it throws an exception. Common reasons for queryXMLNode to fail include:
*A variable that has no query string assigned to it.
*A syntax error in a query string.
*A query fails the “Allows Null” test.
*The node variable does not exist or it is null.