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:

In the Application tab, the following is displayed:

image

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.

image

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

image

This section contains the following topics:

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.
  3. For this example, select the union.dtf file.

  4. Enter the new name and enter the return key.
  5. 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:

    image

  6. 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.
    2. For this example, in the Application tab double-click convert.xq.

    3. Select the Source View tab of the XQ file.
    4. For this example, select the Source View tab of the convert.xq file.

    5. In the first line of the XQ file, change the listed DTF file to the new name.
    6. 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 --} 
      
  7. 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.
  3. For this example, select the convert.xq file.

  4. Enter the new name and enter the return key.
  5. For this example, replace convert with myconvert.

  6. In the Application tab, double-click the DTF file associated with the renamed XQ file.
  7. For this example, in the Application tab double-click union.dtf.

  8. Select the Source View tab of the DTF file.
  9. For this example, select the Source View tab of the union.dtf file.

  10. In the DTF file, change the listed XQ file in the transform annotation to the new name.
  11. 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"
     */ 
    
  12. Save the DTF and the associated XQ file(s). From the menu bar, choose File —> Save All.
Previous Document Next Document