# The Association Between XQ and DTF Files

Associated Transformation (DTF) and XQ files have references to each other in their source code. For example, if you create a Transformation file named union which contains a Transformation method called convert and you create maps between the source and target nodes of the Transformation method the following files are generated:

- A DTF file called union.dtf
- A XQ file called convert.xq

In the Application tab, the following is displayed:

These two files are associated with each other, the union.dtf refers to the convert.xq file and the convert.xq refers to the union.dtf file. If you change the name of either of these files or the transformation method name you must update the reference to it in the other file.

For the preceding example, the following transform annotation is displayed in the Source View of the union.dtf file, as shown in the following figure.

The following comment is displayed in the Source View of the convert.xq file, as shown in the following figure:

This section contains the following topics:

- Rename the DTF File and References in Associated XQ Files
- Rename the XQ File and References In the Associated DTF File

Rename the DTF File and References in Associated XQ Files

1. Save the DTF and the associated XQ file(s). From the menu bar, choose File —> Save All.
2. In the Application tab, right-click the DTF file and from the drop-down menu, select Rename.

For this example, select the union.dtf file.

3. Enter the new name and enter the return key.

For this example, replace union with myunion.

In the Application tab, the DTF file is renamed to myunion.dtf and the associated XQ file (convert.xq) no longer appears under the myunion.dtf file as shown in the following figure:

4. For each of the XQ files associated with a DTF file:

1. In the Application tab, double-click a XQ file associated with the renamed DTF file.

For this example, in the Application tab double-click convert.xq.

2. Select the Source View tab of the XQ file.

For this example, select the Source View tab of the convert.xq file.

3. In the first line of the XQ file, change the listed DTF file to the new name.

The red underline in the first line of the XQ file disappears.

For this example, change the first line from the following code:

    {-- test/union.dtf#convert --}

To this code:

    {-- test/myunion.dtf#convert --}

5. Save the DTF and the associated XQ file(s). From the menu bar, choose File —> Save All.

Rename the XQ File and References In the Associated DTF File

1. Save the DTF and the associated XQ file(s). From the menu bar, choose File —> Save All.
2. In the Application tab, right-click the XQ file and from the drop-down menu, select Rename.

For this example, select the convert.xq file.

3. Enter the new name and enter the return key.

For this example, replace convert with myconvert.

4. In the Application tab, double-click the DTF file associated with the renamed XQ file.

For this example, in the Application tab double-click union.dtf.

5. Select the Source View tab of the DTF file.

For this example, select the Source View tab of the union.dtf file.

6. In the DTF file, change the listed XQ file in the transform annotation to the new name.

The red underline under the XQ name disappears.

For this example, change the annotation from the following code:

    /**
     * @dtf:transform xquery-ref="convert.xq"
     * @dtf:schema-validate return-value="false" parameters="false"
     */

To the following annotation:

    /**
     * @dtf:transform xquery-ref="myconvert.xq"
     * @dtf:schema-validate return-value="false" parameters="false"
     */

7. Save the DTF and the associated XQ file(s). From the menu bar, choose File —> Save All.