Question
· Mar 3, 2017

Debugging XSL transformations in Atelier, using isc:evaluate callback function, advice needed

Hello 

I recently spent some time with Atelier, and tried to use it's inherited (from Eclipse) XSL transformation capabilities.

I have installed Exlipse XML Editor and Tools and Orangevolt XSLT - as it provides Saxon XSLT processor.

I have XSLT 2.0 transformation defined, that uses isc:evaluate() callback function to perform some server side code.

And here is my problem:  when I try to run XSL transformation of a file in my project, then as soon as the processor hits isc:evaluate() it fails. 

I have added all Cache jar's into Orangevolt XSLT confoguration, but apparently I miss something we do with %XML.XSLT2.Transformer class when we provide callback handler function.

Does anyone have experience / knowledge on how to configure the   XSL run environment so it calls to our callback?

here is console output, perhaps it helps you to explain what's going on....

 

[classpath]
 -> C:\InterSystems\HealthShare\dev\java\lib\JDK18\cachedb.jar;C:\InterSystems\HealthShare\dev\java\lib\JDK18\cacheextreme.jar;C:\InterSystems\HealthShare\dev\java\lib\JDK18\cachegateway.jar;C:\InterSystems\HealthShare\dev\java\lib\JDK18\cachejdbc.jar;C:\InterSystems\Atelier\plugins\com.orangevolt.eclipse.xslt.saxon_b_8.9_1.0.7\lib\saxon8-sql.jar;C:\InterSystems\Atelier\plugins\com.orangevolt.eclipse.xslt.saxon_b_8.9_1.0.7\lib\saxon8-xom.jar;C:\InterSystems\Atelier\plugins\com.orangevolt.eclipse.xslt.saxon_b_8.9_1.0.7\lib\saxon8-xpath.jar;C:\InterSystems\Atelier\plugins\com.orangevolt.eclipse.xslt.saxon_b_8.9_1.0.7\lib\saxon8-xqj.jar;C:\InterSystems\Atelier\plugins\com.orangevolt.eclipse.xslt.saxon_b_8.9_1.0.7\lib\saxon8.jar;C:\InterSystems\Atelier\plugins\com.orangevolt.eclipse.xslt_1.0.7\orangevoltxslt-launcher.jar
[transformer class]
net.sf.saxon.TransformerFactoryImpl
[xsl template]
 -> C:\InterSystems\HealthShare\CSP\xslt\DASTA\DS3\DS3-to-SDA3.xsl
[transformer properties]
indent=yes
{http://saxon.sf.net/}indent-spaces=4
[source file]
 -> C:\Users\dkutac\InterSystems\Atelier\workspace\Czech EDGE Gateway\RNN10991_PROP_ZPRAVA_DASTA3_CP1250.XML

C:\Users\dkutac\InterSystems\Atelier\workspace\Czech EDGE Gateway\RNN10991_PROP_ZPRAVA_DASTA3_CP1250.XML -> C:\Users\dkutac\InterSystems\Atelier\workspace\Czech EDGE Gateway\RNN10991_PROP_ZPRAVA_DASTA3_CP1250.xml
Error on line 49 of file:/C:/InterSystems/HealthShare/CSP/xslt/DASTA/DS3/DS3-to-SDA3.xsl:
  Error in call to extension function {public static java.lang.String
  com.intersys.xsltgateway.XSLTGateway.evaluate(java.lang.String,java.lang.String,java.lang.String) throws java.lang.Exception}: Exception in extension function java.lang.NullPointerException
file:/C:/InterSystems/HealthShare/CSP/xslt/DASTA/DS3/DS3-to-SDA3.xsl(49,-1) : here Error in call to extension function {public static java.lang.String com.intersys.xsltgateway.XSLTGateway.evaluate(java.lang.String,java.lang.String,java.lang.String) throws java.lang.Exception}: Exception in extension function java.lang.NullPointerException
; SystemID: file:/C:/InterSystems/HealthShare/CSP/xslt/DASTA/DS3/DS3-to-SDA3.xsl; Line#: 49; Column#: -1

net.sf.saxon.trans.DynamicError: Error in call to extension function {public static java.lang.String com.intersys.xsltgateway.XSLTGateway.evaluate(java.lang.String,java.lang.String,java.lang.String) throws java.lang.Exception}: Exception in extension function java.lang.NullPointerException
    at net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctionCall.java:115)
    at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:265)
    at net.sf.saxon.instruct.SimpleContentConstructor.evaluateItem(SimpleContentConstructor.java:216)
    at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:198)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)
    at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:240)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:365)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:91)

 

thanks in advance!

Discussion (5)0
Log in or sign up to continue

I think you are laboring under a misapprehension. You can only use the XSLT2 Cache functionality through the Java Gateway, originating your request from the cache server. It's s server-side technology. You can use XSLT extensions in Atelier ( or any other tool ) to test and debug your XSLT on filesystem files but you won't be able to use the server callback isc:evaluate() within those stylesheets.

Thank you all for replies,

a few clarifications:

1. I can run the transformation from Cache, using %XML.XSLT2.Tranformer class (and supplying an instance of Cache callback class), this works fine.

2. when there are no isc:evaluate callbacks in the XSL stylesheet, then Atelier runs transformation fine, too.

So, Jamie is right.

PS: this is not an important issue, but I was looking forward to see Eclipse's user friendly debugger in action. But I can live with that limitation, understanding why it is so.

May others find it useful:

I created a small dummy java class that implements public static String evaluate() method (with 1 to 5 arguments for my needs), compiled it and made a jar file.

replaced original references to java:com.intersys.xsltgateway.XSLTGateway by my faked ones (Atelier refactor, easy...) in all used XSL stylesheets.

Then I supplied this dummy jar file into a list of external JAR files to the OrangeVolt XSL run configuration. It all worked fine and I eventually received transformed document (with dummy data in places of original isc:evaluate calls).

Just need to remember to put back pointer to original callback handler class before deploying transformation to Cache server.