XQuery Transformation for Databases
XQuery is designed to retrieve and interpret XML data from any source, whether it is a database or document. Data is stored in relational databases but it is often required that the data be extracted and transformed as XML when interfacing to other components and services. Also, it is an XPath-based querying language supported by most NXD vendors. To perform a query, you need an XQuery transformation scenario.
- Configure the data source drivers and the connection for the particular database.
-
Configure an XQuery transformation scenario.
Once the scenario is associated with the XQuery file, the query can include calls to specific XQuery functions that are implemented by that engine. The available functions depend on the target database engine selected in the scenario. For example, for eXist, the Content Completion Assistant lists the functions supported by that database engine. This is useful for only inserting calls to the supported functions (standard XQuery functions or extension ones) into the query .
-
Run the transformation scenario.
To view a more complex value returned by the query that cannot be entirely displayed in the XQuery query result table at the bottom of the Oxygen XML Developer Eclipse plugin window (for example, an XMLTYPE or CLOB value), do the following:
- Right-click that table cell.
- Select the Copy cell action from the contextual menu to copy the value into the clipboard.
- Paste the value wherever you need it (for example, in an open XQuery editor panel of Oxygen XML Developer Eclipse plugin).