File Open/Save with XSLT

Post here questions and problems related to oXygen frameworks/document types.
tgrantham
Posts: 23

File Open/Save with XSLT

Thu Apr 09, 2015 9:34 pm

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.
tgrantham
Posts: 23

Re: File Open/Save with XSLT

Thu Apr 09, 2015 9:50 pm

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.
Radu
Posts: 5749

Re: File Open/Save with XSLT

Fri Apr 10, 2015 10:44 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
tgrantham
Posts: 23

Re: File Open/Save with XSLT

Fri Apr 10, 2015 4:51 pm

Excellent!

Thank you, Radu.

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 2 guests