Page 1 of 1

Saxon9ee licence for oxygen 18.1 missing?

Posted: Fri Oct 28, 2016 9:50 pm
by cditcher
Our application is deployed as an add on. Since updating to 18.1 we are getting an error related to saxon9ee complaining that there is no licence...? Basic functionality is that we are exporting the document to WordML using an xslt file that makes a call back to our java api. This only works with the enterprise version of saxon and has been working for our add on since at least version 15. There error is:

Error at xsl:variable on line 192 column 79
XPST0017 XPath syntax error at char 0 on line 192 in {props:getProperty($element)}:
Cannot find a matching 1-argument function named
{java:ca.bc.gov.qp.civix.municipal.config.DocxProperties}getProperty(). Reflexive calls to
Java methods require a Saxon-PE or Saxon-EE license, and none was found

You can see the call back is not recognized and the error concludes with "Reflexive calls to
Java methods require a Saxon-PE or Saxon-EE license, and none was found". I reverted to oxygen 17 and the function works just fine. Is there a saxon licencing issue with 18.1?

Re: Saxon9ee licence for oxygen 18.1 missing?

Posted: Mon Oct 31, 2016 11:22 am
by Radu
Hi,

I need more details. Does your add-on also come with its own Saxon JAR libraries (and if so, what version?) or does it rely on the Saxon which comes with Oxygen 18.1 (which is the same one as in 18.0)?
How are you creating the XSLT transformer used to apply the XSLT transformation? Do you use our ro.sync.exml.workspace.api.util.XMLUtilAccess.createXSLTTransformer(Source, URL[], int)? API? Can you give me some Java source code from the place where you are doing this?
Can you also post the entire contents of your plugin.xml plugin descriptor file?

Regards,
Radu

Re: Saxon9ee licence for oxygen 18.1 missing?

Posted: Thu Nov 03, 2016 12:43 am
by cditcher
Thanks Radu. This code snippet was how we were obtaining a transformer instance:

Code: Select all

private static Transformer getTransformer(StreamSource xsl, URIResolver resolver) throws TransformerConfigurationException {
Transformer transformer;
// don't cache transformer if debug property present
if(Config.isDebugMode()) {
TransformerFactory tFactory = TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl", null);
if(resolver != null)
{
tFactory.setURIResolver(resolver);
}
transformer = tFactory.newTransformer(xsl);
}
else {
// get one from cache
transformer = getCachedTransformer(xsl, resolver);
}

return transformer;
}
The only net.sf.saxon.TransformerFactoryImpl on the classpath is the one in Oxygen lib dir. You can see that we have a URIResolver that we pass to TransformerFactory which resolves xsl imports/includes to those in the frameworks dir etc. I have changed the code to use XMLUtilAccess.createXSLTTransformer as you suggested and this does clear up the issue:

Code: Select all


private static Transformer getTransformer(AuthorAccess aa, StreamSource xsl, URIResolver resolver) throws TransformerConfigurationException {
Transformer transformer;
XMLUtilAccess access = aa.getXMLUtilAccess();
if(resolver != null){
access.addPriorityURIResolver(resolver);
}
transformer = access.createXSLTTransformer(xsl, null, XMLUtilAccess.TRANSFORMER_SAXON_ENTERPRISE_EDITION);
access.removePriorityURIResolver(resolver);
transformer.setURIResolver(resolver);
return transformer;
}
However, you can see that we now have to add and then remove a PriorityURIResolver after obtaining a transformer. Perhaps there is a more elegant way of doing this?

Re: Saxon9ee licence for oxygen 18.1 missing?

Posted: Thu Nov 03, 2016 3:56 pm
by Radu
Hi,

Using our API will guarantee that the Saxon transformer that you get is fully licensed. But indeed instantiating the trasformer factory yourself should have also worked.
Do you happen to know if this also worked with 18.0?
Can you post the entire contents of your plugin.xml?

Regards,
Radu

Re: Saxon9ee licence for oxygen 18.1 missing?

Posted: Thu Nov 03, 2016 6:33 pm
by cditcher
We are providing our code as an add-on so do not have a plugin.xml unfortunately. We used to run the code on 15 to ver 17 no problem. We updated directly to 18.1 when the issue appeared. I like the idea of accessing a transformer directly through your api so am happy to make the code change. Aside from the plugin.xml, is there anything else i can provide?

Re: Saxon9ee licence for oxygen 18.1 missing?

Posted: Fri Nov 04, 2016 8:56 am
by Radu
Hi,

We use the term "add-on" to refer to a bundle which contains either a plugin or a framework. The add-on can be installed using our add-on installation support. So I suspect that you do have a plugin and that plugin should have an XML descriptor file. Otherwise, could you tell me more about what your add-on contains and how you install it?

Regards,
Radu