Integration Server 10.3 | Built-In Services Reference Guide | XMLData Folder | Summary of Elements in this Folder | pub.xmldata:queryXMLNode
 
pub.xmldata:queryXMLNode
WmPublic. Queries an XML node and returns the results in the XMLData format in which field names are fully qualified with an ncName and a namespace.
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 node to a particular output variable. At run time, this service must include at least one fields entry and 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.
Each fields list defines bindings for one level of the output with the top-level fields being the pipeline and the first level down fields being contents of a document or document list in the pipeline. As such, the top-level fields parameter is not namespace qualified but the lower-level fields are.
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 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.
nsDecls is not used for creating output fields.
For example, to define the URIs associated with two prefixes called GSX and TxMon, you would set nsDecls as follows:
Instead of defining prefix/namespace pairs in nsDecls, you can specify a namespace for each field using the namespace parameter that is an immediate child of the fields variable, (i.e., fields/namespace)
defaultNamespace
String Optional. The namespace to use as the default for each namespace parameter. An empty string indicates no default namespace.
You can override the default namespace by specifying a namespace for a field in the fields/namespace parameter.
fields
Document List Optional. An array of documents where each document defines a field to be created in the output. Each document contains parameters that describe how data is to be extracted from node. That is, each document in the list contains parameters for a single query.
Key
Value
name
String Optional. Name to assign to the value resulting from the query. That is, the name of a field output by the service.
Typically, this name field is used for top-level fields because top-level fields produced by this service equate to named pipeline variables. However, the name filed may also be used to name the *attributes document.
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.
The query must use the prefix-qualified form for tag names (even though the output is formatted as XmlData). If prefix-qualified names are used, the nsdecls parameter must also be set.
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 Service Development Help.
childTags
String Type of tags generated in the child fields produced by this field. Specify one of the following:
*element to indicate element tags are created. This is the default.
*attribute to indicate attribute tags are created. An attribute tag will not have a particleId.
onnull
String Optional. 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 nested 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. For example, the output variable described by fields/fields is a Document or Document list in the pipeline.
The fields/fields variable and any further nested fields variables contain the same input parameters as the top-level fields (name, query, resultType, etc.) with the addition of the following input parameters needed to identify a particular field in the XMLData formatted document.
The ncName, namespace, and particleId inputs are only supported from the second level and down because the top-level item cannot be an xmldata-formatted tag.
ncName
String Optional. The NCname for the output field.
namespace
String Optional. The namespace portion of the output field. An empty string indicates no namespace.
This namespace value overrides the defaultNamespace value.
particleID
String Optional. The particleId portion of the output field.
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
The pub.xmldata:queryXMLNode is different from the pub.xml:queryXMLNode service which returns the results in the legacy infoset format in which fields are qualified with a prefix and a namespace name. Thepub.xmldata:queryXMLNode service uses the NCName, namespace, and particleID to qualify the output format. Use the pub.xmldata.queryXMLNode service when you are working with XMLData-encoded infoset. Use the pub.xml:queryXMLNode service when you are working with the legacy-encoded infoset.