Page 1 of 1

Test an XSLT file

Posted: Thu Nov 19, 2009 11:40 am
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?

Re: Test an XSLT file

Posted: Thu Nov 19, 2009 3:28 pm
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

Re: Test an XSLT file

Posted: Thu Nov 19, 2009 4:43 pm
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

Re: Test an XSLT file

Posted: Thu Nov 19, 2009 5:20 pm
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