XQuery Parameters
The global parameters of the XQuery file used in a transformation scenario can be configured by using the Parameters button in the XQuery tab.
The resulting dialog box includes a table that displays all the parameters of the current XQuery file, along with their descriptions and current values. You can also add, edit, and remove parameters, and use the Filter text box to search for a specific term in the entire parameters collection. Note that edited parameters are displayed with their name in bold.
If the XPath column is checked, the parameter value is evaluated as an XPath expression before starting the XQuery transformation.
For example, you can use expressions such as:
doc('test.xml')//entry //person[@atr='val']
Note
- The doc function solves the argument relative to the XQuery file location. You
can use full paths or editor variables (such as ${cfdu} [current file
directory]) to specify other locations:
doc('${cfdu}/test.xml')//*
- Only XPath functions are allowed.
Below the table, the following actions are available for managing the parameters:
- New
- Opens the Add Parameter dialog box that allows you to add a new parameter to the list. An editor variable can be inserted in the text box using the Insert Editor Variables button. If the Evaluate as XPath option is enabled, the parameter will be evaluated as an XPath expression.
- Edit
- Opens the Edit Parameter dialog box that allows you to edit the selected parameter. An editor variable can be inserted in the text box using the Insert Editor Variables button. If the Evaluate as XPath option is enabled, the parameter will be evaluated as an XPath expression.
- Unset
- Resets the selected parameter to its default value. Available only for edited parameters with set values.
The bottom panel presents the following:
- The default value of the parameter selected in the table.
- A description of the parameter, if available.
- The system ID of the stylesheet that declares it.