User Guide > Using Transformations > Creating an XQuery Transformation > Specifying Settings for Target Sources in an XQuery Transformation
 
Specifying Settings for Target Sources in an XQuery Transformation
To specify the sources, values, and other settings for target sources in the XQuery transformation
1. In the Model panel, specify the sources, target values, and source aliases to provide the data and constraints for the output XML document.
In the current example, the top-level elements in the Target column are Inventory Transactions, Transaction, PurchaseOrder, Supplier, and Product. You can specify a source for each of these elements.
2. To specify a source:
Double-click the Source cell corresponding to the top-level element in the Target column.
Or
Select the top-level element in the Target column and click the Choose Source toolbar button.
3. In the window that opens, select the source table and click OK.
4. If you want to change the automatically assigned alias, type a different alias in the Source Alias column for the source you just added.
The aliases are used when join conditions, filters, and inputs are supplied for a source value.
5. To specify a value for a target, click the Target Value cell corresponding to the target in the Target column, and select a value from the drop-down list, as follows.
For a target value, you can supply a literal value or a system function to be evaluated at runtime. Literal values must be enclosed in single or double quotes.
6. To specify a source setting, click the appropriate icon in the Source Settings column, or click the Show Source Settings toolbar icon to display the source settings panel in the lower section if it is not already visible. Then open the Join, Filter, Sort Order, or Inputs panel and supply the settings.
PurchaseOrderID = $INV/PurchaseOrderID (in the Join panel) means that PurchaseOrderID in PurchaseOrder is joined to PurchaseOrderID in the ancestor InventoryTransactions. The syntax for the value expression $INV/PurchaseOrderID contains a reference to the alias (INV) for the parent source inventorytransactions preceded by the dollar sign ($).
7. To supply a value for an input parameter, if the source is a procedure that has input parameters, use the Inputs panel (in the source settings panel).
a. Click the Inputs tab to open the Inputs panel.
b. Click the Inputs icon in the Source Settings column.
In the Inputs panel, the names of the inputs are displayed, and the Is NULL check box is selected by default.
c. Click the row in the Value column, and select an appropriate value for the input parameter in the drop-down list.