difficulty configuring XSLT extensions

Here should go questions about transforming XML with XSLT and FOP.
mstoef
Posts: 20
Joined: Tue May 23, 2006 11:10 pm

difficulty configuring XSLT extensions

Post by mstoef »

I have a stylesheet that incorporates several java extension classes that I'm trying to get added on to a transform scenario, but not with success yet.
- I binded all the ns prefixes to the appropriate class path.
- I put the appropriate jar files in a directory and added their paths in the scenario dialog.

I ran the transform and generated error:

Code: Select all

[Saxon-B 9.1.0.3] org/apache/commons/pool/PoolableObjectFactory
and so I added commons-pool-1.4.jar to my extensions list.

Re-running the transform then, however, generated error:

Code: Select all

[Saxon-B 9.1.0.3] org/jdom/Element
which I don't understand what to do with.

Running Oxygen 10.0 on Mac OSX 10.5.6 (java 1.5.0_16).

Any help greatly appreciated.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: difficulty configuring XSLT extensions

Post by sorin_ristache »

Hello,
mstoef wrote:Re-running the transform then, however, generated error:

Code: Select all

[Saxon-B 9.1.0.3] org/jdom/Element


which I don't understand what to do with.

Running Oxygen 10.0 on Mac OSX 10.5.6 (java 1.5.0_16).

Any help greatly appreciated.
The error message reported by Saxon 9 is not helpful but that is the complete error message that Saxon 9 reports. Can you send some somple files (XML file, XML file, extension jar) for finding more about the error?


Regards,
Sorin
mstoef
Posts: 20
Joined: Tue May 23, 2006 11:10 pm

Re: difficulty configuring XSLT extensions

Post by mstoef »

It's a big load. The jars are almost 50 mb combined. I don't suppose there is a way to invoke this directly via Saxon in hopes of gaining a more verbose error report?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: difficulty configuring XSLT extensions

Post by sorin_ristache »

Did you add jdom.jar to the list of scenario extensions? It seems the error is a ClassNotFoundException because this JDOM class is not on the classpath.


Regards,
Sorin
mstoef
Posts: 20
Joined: Tue May 23, 2006 11:10 pm

Re: difficulty configuring XSLT extensions

Post by mstoef »

Do you mean saxon's jdom (i.e., saxon9-jdom.jar) or jdom.jar from jdom.org? I don't see saxon9-jdom.jar in the oxygen lib directory. I installed jdom 1.0 via MacPorts, but when I add it as a scenario jar, Oxygen crashes. I have saxon saxonb9-1-0-3j installed as a separate application, but when I add the path to saxon9-jdom.jar to the extension list, I get no change in the error reporting.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: difficulty configuring XSLT extensions

Post by sorin_ristache »

The class org.jdom.Element is in jdom.jar from jdom.org. saxon9-jdom.jar does not contain this class. It seems that the jars that you added as scenario extensions depend on jdom.jar.

Does the Java virtual machine crash when you add jdom.jar as scenario extension and run the scenario? Is there an error message? Please send the crash log file generated by the operating system.


Regards,
Sorin
mstoef
Posts: 20
Joined: Tue May 23, 2006 11:10 pm

Re: difficulty configuring XSLT extensions

Post by mstoef »

The JVM does appear to crash (i.e., Oxygen window disappears, no error message). Re the crash log, I'm not sure where to look. In /Library/Logs/CrashReporter, there are no report files. In ~/Library/Logs/CrashReporter there are no current files. Any idea where to look?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: difficulty configuring XSLT extensions

Post by sorin_ristache »

Start Oxygen from a console with a command:

Code: Select all

sh oxygenMac.sh
and see if there is an error message in the console. OS X should display the location and name of a crash file that it generates because the JVM is an OS X process controlled by OS X.

oxygenMac.sh is located in the Oxygen install folder.


Regards,
Sorin
mstoef
Posts: 20
Joined: Tue May 23, 2006 11:10 pm

Re: difficulty configuring XSLT extensions

Post by mstoef »

Well, I didn't get any messages on start up when launching form the shell. But when I attempted again to run the scenario, I got this stack:

fail to get root dir of web app. servlet context is not given and acs.home is not defined
java.lang.Exception
at com.atypon.literatum.util.WebAppContext.getSiteRootDir(WebAppContext.java:131)
at com.atypon.literatum.util.WebAppContext.getSiteRootDir(WebAppContext.java:98)
at com.atypon.literatum.registry.PropertyFileLocator.getUriList(PropertyFileLocator.java:62)
at com.atypon.literatum.registry.RegistryUtil.getPropertyFileList(RegistryUtil.java:197)
at com.atypon.literatum.registry.Registry.<init>(Registry.java:54)
at com.atypon.literatum.registry.Registry.<clinit>(Registry.java:44)
at com.atypon.literatum.registry.Conf.getString(Conf.java:277)
at com.atypon.publish.util.xml.XslJavaExtension.<clinit>(XslJavaExtension.java:1094)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(ExtensionFunctionCall.java:690)
at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:343)
at net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctionCall.java:224)
at net.sf.saxon.instruct.SaxonTraceWrapper.iterate(Unknown Source)
at net.sf.saxon.instruct.SaxonTraceWrapper.iterate(Unknown Source)
at net.sf.saxon.instruct.SaxonTraceWrapper.iterate(Unknown Source)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:308)
at net.sf.saxon.instruct.GlobalVariable.getSelectValue(GlobalVariable.java:209)
at net.sf.saxon.instruct.GlobalVariable.evaluateVariable(GlobalVariable.java:233)
at net.sf.saxon.Controller.preEvaluateGlobals(Controller.java:1878)
at net.sf.saxon.Controller.transformDocument(Controller.java:1769)
at net.sf.saxon.Controller.transform(Controller.java:1621)
at ro.sync.exml.editor.a.o.A(Unknown Source)
at ro.sync.exml.editor.a.o.A(Unknown Source)
at ro.sync.exml.editor.a.o$7.?(Unknown Source)
at ro.sync.ui.application.B.run(Unknown Source)
acs home = null
Error in loading initial XML configuration files: the system property "acs.home" is not found
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: difficulty configuring XSLT extensions

Post by sorin_ristache »

The initialization of your extension class com.atypon.publish.util.xml.XslJavaExtension calls the method getSiteRootDir() of an object of type com.atypon.literatum.util.WebAppContext and that issues an error message. I do not know what is the correct result of calling the com.atypon.literatum classes displayed in the error (PropertyFileLocator, WebAppContext, etc) and I do not know how to use the com.atypon.literatum classes correctly but it seems an error in the logic of your Java extension.

I am sure you will get the same result if you run the same transformation using Saxon 9 from command line (the Saxon 9 jar files that come with Oxygen or saxonb9-1-0-3j that you said you have installed to other directory), for example:

Code: Select all

java -cp lib/saxon9sa.jar:your/path/to/extension.jar:your/path/to/commons-pool-1.4.jar:your/path/to/jdom.jar  net.sf.saxon.Transform  -s:path/to/input.xml  -xsl:path/to/stylesheet.xsl
Make sure you specify the correct path to the jar files: the Saxon 9 files (lib/saxon9sa.jar in the above example, if the current directory is the Oxygen install directory), the jar file with your Java extension (your/path/to/extension.jar in the above examples), etc. and also the correct path of the input XML file (the -s parameter) and the correct path of the XSLT stylesheet (the -xsl parameter).


Regards,
Sorin
Post Reply