Execute XSLT Transformation on Save in Custom Framework

Post here questions and problems related to oXygen frameworks/document types.
csonder
Posts: 3
Joined: Wed Jan 15, 2025 12:56 pm

Execute XSLT Transformation on Save in Custom Framework

Post by csonder »

Dear Oxygen-Community,

I have a custom Oxygen framework that is shipped to my colleagues working with XML files.
We want to execute a XSLT transformation whenever a XML file that belongs to the framework is saved.
Is this possible? Are there any "event hooks" like "on save", for example?
Radu
Posts: 9343
Joined: Fri Jul 09, 2004 5:18 pm

Re: Execute XSLT Transformation on Save in Custom Framework

Post by Radu »

Hi,
What would the XSLT processing do? Publish some content to another format? Or apply the XSLT somehow on the XML document as a kind of post-processing when the save operation is invoked? After the XSLT is applied do you want to open a certain result file in Oxygen or a system application?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
csonder
Posts: 3
Joined: Wed Jan 15, 2025 12:56 pm

Re: Execute XSLT Transformation on Save in Custom Framework

Post by csonder »

Thanks, Radu, for your fast response.
The XSLT should do some kind of postprocessing on the same XML file. There is no need to open another file or application.
We already have the transformation scenario and have integrated it into our framework, the only thing is, one has to start
the transformation via the "Start Transformation Button", but we want this to execute every time a file is saved to the disk.
Radu
Posts: 9343
Joined: Fri Jul 09, 2004 5:18 pm

Re: Execute XSLT Transformation on Save in Custom Framework

Post by Radu »

Hi,
In general a framework configuration is useful mostly for configuring behaviors and custom actions when working in the Author visual editing mode.
We have open and save hooks which can be added from an Oxygen plugin, for example this sample plugin which uses Javascript to call our APIs and add two hooks, one for open and one for save. Each hook calls an XSLT stylesheet.
https://github.com/oxygenxml/wsaccess-j ... XSLTFilter
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
csonder
Posts: 3
Joined: Wed Jan 15, 2025 12:56 pm

Re: Execute XSLT Transformation on Save in Custom Framework

Post by csonder »

Thanks again for your fast response!
We will investigate if a plugin meets our needs. Is it possible to deliver a plugin within a framework or does a plugin have to be set up separately?
Radu
Posts: 9343
Joined: Fri Jul 09, 2004 5:18 pm

Re: Execute XSLT Transformation on Save in Custom Framework

Post by Radu »

Hi,

Delivering a framework with a plugin inside is not possible.
But it's possible to deliver a plugin with one or multiple frameworks inside it.
https://www.oxygenxml.com/doc/versions/ ... nsion.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply