Page 1 of 1

File Open/Save with XSLT

Posted: Thu Apr 09, 2015 9:34 pm
by tgrantham
Adobe Framemaker has the capability to run an XSLT transform on a file when it is opened or saved.

Is there a way to do this in oxygen?

Thanks,
Tim.

Re: File Open/Save with XSLT

Posted: Thu Apr 09, 2015 9:50 pm
by tgrantham
I just stumbled across the topics in the online help on modifying XML documents on open and save, so it obviously can be done via a plugin.

But is there a simpler way?

Thanks,
Tim.

Re: File Open/Save with XSLT

Posted: Fri Apr 10, 2015 10:44 am
by Radu
Hi Tim,

Indeed our Java-based API can be used to process the contents of an XML immediately after it is opened or before it is saved.

For Oxygen 17.0 (which we plan to release in April-May this year) we plan to add support for a feature called Dynamic Conversion. Basically it's a new URL protocol called convert which has various pre-defined processors (for example an XSLT or Xquery processor, a Javascript processor, Java and so on). Processors can be assembled in a pipeline. And you can also define reverse conversion processors which are used when content is modified and saved in the editor.

So if you would construct an URL like:

convert:/processor=xslt;ss=urn:processors:convert.xsl/rprocessor=xslt;ss=urn:processors:rconvert.xsl!/urn:files:myFile.xml

it would apply the convert.xsl over the file and open the content in the editor.
Then after the XML is modified and saved, it will apply the rconvert.xsl over the modified content and save the results to disk.

So if you are interested in this after Oxygen 17 is released our user manual will contain examples for this + link to a GitHub project containing samples.
For example one of the samples will convert comma separated values (CSV) to XML and then port the modifications back to CSV when the user saves the content.

Regards,
Radu

Re: File Open/Save with XSLT

Posted: Fri Apr 10, 2015 4:51 pm
by tgrantham
Excellent!

Thank you, Radu.