Chaining transformations

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Chaining transformations

Post 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
Frank Ralf
parson AG
www.parson-europe.com
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Chaining transformations

Post 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
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Chaining transformations

Post by Frank Ralf »

Thanks for the quick reply and the information, Alex!

Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Chaining transformations

Post 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
Frank Ralf
parson AG
www.parson-europe.com
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Chaining transformations

Post 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
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Chaining transformations

Post by Frank Ralf »

Hi Alex,

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

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
fsteimke
Posts: 80
Joined: Tue Jan 01, 2013 3:19 pm

Re: Chaining transformations

Post 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
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Chaining transformations

Post 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
Frank Ralf
parson AG
www.parson-europe.com
Post Reply