Run XSLT or XQuery Transformations
Use Case
You want to run XSL 2.0 / 3.0 transformations with Saxon EE using the Oxygen SDK.
Solution
The API class ro.sync.exml.workspace.api.util.XMLUtilAccess allows you
to create an XSLT Transformer that implements the JAXP interface
javax.xml.transform.Transformer. Then this type of transformer can be
used to transform XML. Here's just an example of transforming when you have an
AuthorAccess API available:
InputSource is = new org.xml.sax.InputSource
(URLUtil.correct(new File("test/personal.xsl")).toString());
xslSrc = new SAXSource(is);
javax.xml.transform.Transformer transformer =
authorAccess.getXMLUtilAccess().createXSLTTransformer
(xslSrc, null, AuthorXMLUtilAccess.TRANSFORMER_SAXON_ENTERPRISE_EDITION);
transformer.transform(new StreamSource(new File("test/personal.xml")),
new StreamResult(new File("test/personal.html")));
If
you want to create the transformer from the plugin side, you can use this
method instead:
ro.sync.exml.workspace.api.PluginWorkspace.getXMLUtilAccess().