Page 1 of 1

Chaining transformations

Posted: Tue Apr 15, 2014 5:48 pm
by Frank Ralf
Hi,

For XSLT transformation scenarios one can apply Additional XSLT stylesheets after the main XSLT transformation (http://www.oxygenxml.com/doc/ug-author/ ... t-tab.html).

I'd like to first apply an XSLT transformation and then a PDF transformation to the same XML file. Is that possible? If not as a transformation scenario then perhaps as an Author Action, using the ExecuteMultipleActionsOperation (http://www.oxygenxml.com/doc/ug-author/ ... tions.html)?

Kind regards,
Frank

Re: Chaining transformations

Posted: Wed Apr 16, 2014 9:17 am
by alex_jitianu
Hello,

There are a couple of ways of doing that:
1. In the Configure transformation Scenario dialog you can associate multiple scenarios at once. All of them will be executed when clicking Apply transformation scenarios. Please note that the scenarios can be associate by default in the Transformation tab of the Document Type Settings Dialog. This way all the user has to do in press the transformation button.
2. If you prefer an author operation, there is an ExecuteTransformationScenariosOperation. Again, you must define two transformation scenarios in the document type and you give their names as a parameter to the operation.


Best regards,
Alex

Re: Chaining transformations

Posted: Wed Apr 16, 2014 10:18 am
by Frank Ralf
Thanks for the quick reply and the information, Alex!

Frank

Re: Chaining transformations

Posted: Fri Sep 12, 2014 10:27 am
by Frank Ralf
Hi,

I'm still struggling with this problem. Perhaps I should have stated my use case more clearly. I don't want to apply two transformations to the same input file but rather first apply an XSLT transformation to the file and then a second (DITA) transformation to the result of the first transformation.

Any pointers are welcome.

TIA
Frank

Re: Chaining transformations

Posted: Fri Sep 12, 2014 1:53 pm
by alex_jitianu
Hello Frank,

1. Using the multiple scenarios approach, you must have two scenarios:
- one scenario that takes the current file, transforms it and saves the output in a predefined location. For example to ${userHome}/toBeProcessed.dita.
- the second scenario, a DITA type scenario, modified to take as input (probably on the parameter args.input) the previous scenario's output: ${userHome}/toBeProcessed.dita.

The two scenarios can be executed from an author action that uses an ExecuteTransformationScenariosOperation. The two scenarios must sit in the document type associated with the currently edited file.

2. Another possibility is to use a custom build file in the DITA transformation scenario. In this ANT build file you can execute the XSLT transformation before calling the default target. Basically something similar with the two scenarios approach but you replace the stuff done by the first scenario with what you do in the build file (using an xslt ANT task).

Please let me know if there is any any additional information I can provide regarding any of the previous solutions.

Best regards,
Alex

Re: Chaining transformations

Posted: Tue Sep 16, 2014 10:30 am
by Frank Ralf
Hi Alex,

Thanks for the instructions. I will try this and report back.

Kind regards,
Frank

Re: Chaining transformations

Posted: Tue Sep 23, 2014 3:14 pm
by fsteimke
Hi Frank,

another possibility would be the use of xproc. As far as i understand, it is designed for the "chaining of transformations", so it should fit to your needs. And it is supported by Oxygen, of course.

Did you ever give it a try?

regards,
Frank Steimke

Re: Chaining transformations

Posted: Thu Sep 25, 2014 2:53 pm
by Frank Ralf
Hi Frank,

Thanks for the pointer. I've heard a lot about XProc lately but haven't tried it yet. Sounds quite promising ;-)

Kind regards,
Frank