Convert folder having xml into their corresponding pdf

Post here questions and problems related to oXygen frameworks/document types.
sdhingra6
Posts: 3
Joined: Wed Nov 19, 2014 11:07 am

Convert folder having xml into their corresponding pdf

Post by sdhingra6 »

Hey!
I want to convert the folder having xml into their corresponding pdf using xsl ie at directory level. but i am not able to do so since oxygen gives transformation at file level.How to do so?option?
Costin
Posts: 829
Joined: Mon Dec 05, 2011 6:04 pm

Re: Convert folder having xml into their corresponding pdf

Post by Costin »

Hello,

If you have a common XSL file that you need to apply to several XML files, you should create a transformation scenario which you could associate with all those specific XML files afterwards.

To reach the transformation scenario configuration dialog you can either:
- open one XML file and from the main menu invoke Document -> Transformation -> Configure Transformation Scenario(there's also a corresponding action in the toolbar, with a "wrench and play button" like icon)
- add the XML files to the project, right click on one of them in the Project view and from the contextual menu choose Transform -> Configure Transformation Scenario.

Further on, make sure the scenario type is "XML transformation with XSLT" and click 'New' to create a new scenario:
1. Give it an appropriate name
2. Leave the 'XML URL' field to its default(${currentFileURL})
3. In the XSL URL field browse for the stylesheet you need to use in the transformation process
4. If you have an XSLT 2.0 stylesheet choose from the transformer combo Saxon-PE, otherwise you can leave it to Saxon6.5.5.
5. You can further tune the transformation options, like the "FO Processor" (in your case you should set "pdf" as the transformation method) and the "Output". Please note that the "Save as" field must refer a single file, NOT an output directory. Use the editor variables to compose a generic name instead of a fixed one.
e.g in the "Save as" field you can specify: ${cfd}/${cfn}-out.xml which translates into <current-file-directory>/<current-filename>-out.xml
6. OK in all dialogs.

To apply this scenario to several XML files first add them to the same folder in your project, then select the specific folder in the Project view and from the contextual menu(right click) choose either:
- Transform -> "Transform with...", then select your scenario from the list and press 'Transform now'
- Configure Transformation Scenario and select your scenario from the list and press 'Transform now'. This will also associate the scenario with the files in the selected folder, so next time you can simply use "Apply Transformation Scenario" and the associated scenario will be used.

The transformation scenario will be applied by Oxygen separately for each XML file. This is why the output of the transformation scenario must refer a single file.

I hope this helps and let us know if you need any other information or assistance.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
sdhingra6
Posts: 3
Joined: Wed Nov 19, 2014 11:07 am

Re: Convert folder having xml into their corresponding pdf

Post by sdhingra6 »

Thank you so much :) It was indeed a great help :)
Post Reply