Integration Server 10.5 | Built-In Services Reference Guide | XML Folder | Summary of Elements in this Folder | pub.xml:queryXMLNode
 
pub.xml:queryXMLNode
WmPublic. 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 or enhanced 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 pub.xml:loadXMLNode, pub.xml:xmlStringToXMLNode or an XML content handler.
*enhanced XML node The enhanced XML node that you want to query. An enhanced XML node can be produced by pub.xml:loadEnhancedXMLNode, pub.xml:xmlStringToEnhancedXMLNode, or an XML content handler that receives a document with an xmlFormat is set to enhanced. If you supply an enhanced XML node, you must use XQL to query the node.
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.
If the content of node is an enhanced XML node, you must set queryType to XQL.
For information about WQL syntax, see the webMethods Integration Server Built-In Services Reference.
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 pub.xml:queryXMLNode fails, it throws a server exception. Common reasons for pub.xml: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 Nulls” test.
*The node variable does not exist or it is null.