<retrieveXML>

The retrieveXML operation generates zero or one XML documents from a set of relational tables using the XML Collection access method.

This operation is currently implemented by the dxxGenXML or dxxRetrieveXML stored procedures, or the new dxxGenXMLClob and dxxRetrieveXMLClob depending on the value of the useXmlClob property defined in the group.properties file.

The new stored procedures are faster and more portable but differ in that they return at most one document. To make the semantics of the operation independent of the stored procedures used to implement them, only a single document is requested when using the old stored procedures. This change affects the XML Schema generated for the output in preliminary versions of this specification (maxOccurs="unbounded" previously, but maxOccurs="1" now).

This operation is implemented by dxxGenXMLClob since a <DAD_ref> element is used but would be implemented by dxxRetrieveXMLClob if a <collection_name> element had been used.

The dxxGenXMLClob stored procedure takes as arguments a DAD document and an optional override. The override can be either SQL or XML. If the override is SQL then the DAD must use SQL mapping. If the override is XML then the DAD must use RDB_node mapping. Our DAD is using RDB_node as well. If an override is defined, then the operation can also define one or more <parameter> elements. The parameters form the input message. DxxInvoker extracts the parameters from the input message, validates them, and then substitutes them into the override by replacing the parameter markers, e.g. :flightNo.

The dxxGenXMLClob returns zero or one XML documents that satisfy that DTD referenced by the DAD file. DxxInvoker invokes the dxxGenXMLClob stored procedure, retrieves the result set and places it in the output message.

Since we want to query the database using a search criteria, we need to use an XML_override tag and a XPath expression in the DADX file to do it. The XML_override tag allows you to specify your XPath expression for doing a query. We need to specify that we are querying using flight number, so we customize our DADX file as shown in Example 9-6:

1.Add an <dadx:XML_override> element in the DADX editor

2.Add an XPath expression to specify the parameter.

204 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 220
Image 220
IBM Version 5 manual RetrieveXML