Test an XSLT file

Here should go questions about transforming XML with XSLT and FOP.
dfx
Posts: 3
Joined: Thu Nov 19, 2009 11:22 am

Test an XSLT file

Post by dfx »

Hi,
I currently have the Apply Transformation Scenario button configured so that if I select the XSL file to transform, it will use the xml file of the same name. How can I set up different xml files for all my test cases and then transform all these files in one go?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Test an XSLT file

Post by sorin_ristache »

Hello,

You run a batch of transformations in one go with the action Apply Transformation Scenario or with the action Configure Transformation Scenario that are available in the contextual menu of the Project view. That means you have to add the files of the test cases to the same folder of an Oxygen project that is loaded in the Project view, right click (Cmd-click on Mac computers) on the folder and select one of the two actions. The first one runs the scenario that is associated with each file. The second action allows you to select a scenario from the list of all available scenarios and apply that scenario to all selected files.

The files don't have to be in the same folder. You can select the files one by one with Ctrl + click in the Project view and after that right click (or Cmd-click) and select the action from the contextual menu which will apply the action to the current selection.

The two actions are described in the User Manual.


Regards,
Sorin
dfx
Posts: 3
Joined: Thu Nov 19, 2009 11:22 am

Re: Test an XSLT file

Post by dfx »

Thanks,

I'm relatively new to this kind of editing. My transformation scenario is configured to transform the XSL file from the XML file in the scenario. I think I need to do the reverse and create a scenario for one XML file that uses the XSL file I want to test, then select all my XML files and use that transformation scenario.

If I do that and select FO pdf, the transformation fails because I don't have an element called root or use a namespace from W3.org
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Test an XSLT file

Post by sorin_ristache »

If you want to apply the same XSL stylesheet to many XML files you can reuse the same scenario. Set the editor variable ${currentFileURL} as XML URL and the URL of the XSL stylesheet as XSL URL.


Regards,
Sorin
Post Reply