In the following tasks, you select the source and target types from the Source or Target panes of the Configure XQuery Transformation Method - methodName dialog box. (Where methodName represents the current Transformation method.) Source types are the input data types for the data transformation—the data types that are transformed to the target data type.
This section contains the following tasks:
To Select the Source and Target Types
For instructions on creating a Transformation file see To Create a Transformation File From the Menu Bar.
To select an existing Transformation file:
For instructions on creating a method in a Transformation file, see To Add a Transformation Method to Transformation File.
To select an existing method, in the Design View of the Transformation file (ends in the .dtf extension), right-click the arrow representing the method, as shown in the following figure:
The Configure XQuery Transformation Method dialog box is displayed. In the Available Source Types pane of Configure XQuery Transformation Method dialog box, the list of available source types are displayed.
Note: In order for schema representations to be available in the Available Source Types and Available Target Types pane, the XSD and MFL files which contain these schemas must be imported into a Schemas project folder and the current application must have completed building. To learn more, see Selecting Source and Target Types.
To specify an XML, Non-XML, or Java primitives source type:
To specify a Java class source type:
To learn more, see Using Java Classes in Transformations.
The elements and attributes that make up the selected element are displayed in the Selected Source Types pane.
Note: Non-XML Types/Untyped/RawData is not supported as a source or target type for a Transformation method. RawData has no associated structure and therefore can not be transformed using the mapper. To learn more, see Create a New Instance of an MflObject From Untyped Raw Data Example.
Note: Multiple source types can be specified.
To specify an XML, Non-XML, or Java primitives target type:
To specify a Java class target type:
To learn more, see Using Java Classes in Transformations.
The elements and attributes that make up the selected element are displayed in the Selected Target Types pane.
Note: Only one target type can be specified.
If this check box is selected, during run time the source parameters are validated against their schema types before the transformation is executed. To learn more, see Schema Validating During Run Time.
Note: The Schema Validate Parameters check box will only be enabled if all the parameters and the return type are typed XML or typed MFL types.
If selected, during run time the target parameter is validated against its schema type after the transformation is executed. To learn more, see Schema Validating During Run Time.
Note: The Schema Validate Return check box will only be enabled if all the parameters and the return type are typed XML or typed MFL types.
Note: You do not have to select an source type but you must select an target type.
An XQ file (ending in the .xq extension) is created to store the query and displayed in the Application tab. The query is written in the XQuery language. XQ files are associated with a particular DTF file and appear indented under the associated DTF file in the Application tab. To learn more, see The Association Between XQ and DTF Files.
To Change the Selected Source or Target Parameters
If links have been created between source and target types in the Design View of an XQ file, then XQuery code has been generated which refers to the source and target types.
If you change the source and target types of the query, the existing XQuery code remains unchanged and may be referencing the original source or target types which may be no longer valid for this query. The XQuery code in the query may now be invalid and may require some manual XQuery code clean up as described in the last step in the following task.
Note: You may be able to minimize the amount of clean-up required by using the same name for the source variable in both the original and new query. Instead of having different names for the original and new source variables, for example: oldOrderDoc/po-number and newOrderDoc/po-number, respectively, use the same name: orderDoc/po-number for both.
To change or add source parameters or change the target parameter:
The Configure XQuery Transformation Method dialog box is displayed.
If this check box is selected, during run time the source parameters are validated against their schema types before the transformation is executed. To learn more, see Schema Validating During Run Time.
Note: The Schema Validate Parameters check box will only be enabled if all the parameters and the return type are typed XML or typed MFL types.
If selected, during run time the target parameter is validated against its schema type after the transformation is executed. To learn more, see Schema Validating During Run Time.
Note: The Schema Validate Return check box will only be enabled if all the parameters and the return type are typed XML or typed MFL types.
To view the XQuery source code including any errors:
The XQuery code is displayed and the invalid XQuery code is underlined in red.
If desired, you can delete all the XQuery code in the Source View of the XQ file by removing all the XQuery source code after the namespace declaration(s) and recreating your links in the Design View.
Updating the Graphical Representation Displayed in the Source View of a XQ File
The following procedure describes how to force the mapper to display an updated graphical representation of an XQ file in the Design View, if you have manually changed the source or target parameters of a Transformation method in the Source View of the Transformation file. To update the graphical representation of the XQ file, complete the following steps:
The Configure XQuery Transformation Method dialog box is displayed.
The graphical representation of the object is displayed in the Design View of the XQ file.
![]() |
![]() |