Chaining transformations

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Frank Ralf
Posts: 370
Location: Hamburg

Chaining transformations

Tue Apr 15, 2014 5:48 pm

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: 650

Re: Chaining transformations

Wed Apr 16, 2014 9:17 am

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: 370
Location: Hamburg

Re: Chaining transformations

Wed Apr 16, 2014 10:18 am

Thanks for the quick reply and the information, Alex!

Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 370
Location: Hamburg

Re: Chaining transformations

Fri Sep 12, 2014 10:27 am

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: 650

Re: Chaining transformations

Fri Sep 12, 2014 1:53 pm

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: 370
Location: Hamburg

Re: Chaining transformations

Tue Sep 16, 2014 10:30 am

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: 41

Re: Chaining transformations

Tue Sep 23, 2014 3:14 pm

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: 370
Location: Hamburg

Re: Chaining transformations

Thu Sep 25, 2014 2:53 pm

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

Return to “Common Problems”

Who is online

Users browsing this forum: Google [Bot] and 4 guests