How to Test the Transformation Mapping Logic

The Test XSL Map dialog shown in Figure 41-39 enables you to test the transformation mapping logic you designed with the XSLT Map Editor. The test settings you specify are stored and do not need to be entered again the next time you test. Test settings must be entered again if you close and reopen Oracle JDeveloper.

Figure 41-39 Test XSL Map Dialog

Description of Figure 41-39 follows
Description of "Figure 41-39 Test XSL Map Dialog"

To test the transformation mapping logic:

  1. In the Source XML File field, choose to allow a sample source XML file to be generated for testing or click Browse to specify a different source XML file.

    When you click OK, the source XML file is validated. If validation passes, transformation occurs, and the target XML file is created.

    If validation fails, no transformation occurs and a message displays on-screen.

  2. Select the Generate Source XML File check box to create a sample XML file based on the map source XSD schema.

  3. Select the Show Source XML File check box to display the source XML files for the test. The source XML files display in an Oracle JDeveloper XML editor.

    If the map has defined parameters, the Parameters With Schema or Parameters Without Schema table can appear.

    1. If the Parameters With Schema table appears, you can specify an input XML file for the parameter using the Browse button. Select the Generate File check box to generate a file.

    2. If the Parameters Without Schema table appears, you can specify a value by selecting the Specify Value check box and making appropriate edits to the Type and Value columns.

  4. In the Target XML File field, enter a file name or browse for a file name in which to store the resulting XML document from the transformation.

  5. Select the Show Target XML File check box to display the target XML file for the test. The target XML file displays in an Oracle JDeveloper XML editor.

  6. If you select to show both the source and target XML, you can customize the layout of your XML editors. Select Enable Auto Layout in the upper right corner and click one of the patterns.

  7. Click OK.

    The test results shown in Figure 41-40 appear.

    For this example, the source XML and target XML display side-by-side with the XSL map underneath (the default setting). Additional source XML files corresponding to the Parameters With Schema table are displayed as tabs in the same area as the main source file. You can right-click an editor and select Validate XML to validate the source or target XML against the map source or target XSD schema.