Settings up an external processor

Here should go questions about transforming XML with XSLT and FOP.
iceandrews
Posts: 3
Joined: Tue Mar 20, 2018 5:56 pm

Settings up an external processor

Post by iceandrews »

I'm trying to use a saxon8.jar file that I use via command line as the XSLT Processor in Oxygen 20. I'm having some various issues getting it setup correctly.

What value do I set the System Property javax.xml.transform.TransformerFactory?
What value do I assign in Oxygen in the JAXP XSLT Transformer section?

When I put the saxon8.jar in the \lib folder Oxygen won't open with the following stack:

Code: Select all

Cannot start <oXygen/> XML Editor.
Due to:java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at ro.sync.ui.application.ApplicationLauncher.d(Unknown Source)
at ro.sync.ui.application.ApplicationLauncher.launch(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ro.sync.exml.Oxygen.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:81)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
Caused by: java.lang.IllegalAccessError: tried to access method net.sf.saxon.java.JavaPlatform.<init>()V from class net.sf.saxon.Version
at net.sf.saxon.Version.<clinit>(Unknown Source)
at ro.sync.xml.transformer.r.k(Unknown Source)
at ro.sync.f.g$3.getListCellRendererComponent(Unknown Source)
at ro.sync.ui.application.ic.km(Unknown Source)
at ro.sync.ui.application.ic.pm(Unknown Source)
at ro.sync.ui.application.ic$_b.getListCellRendererComponent(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.changeSelection(Unknown Source)
at javax.swing.DefaultListSelectionModel.changeSelection(Unknown Source)
at javax.swing.DefaultListSelectionModel.removeSelectionIntervalImpl(Unknown Source)
at javax.swing.DefaultListSelectionModel.clearSelection(Unknown Source)
at javax.swing.JList.clearSelection(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.setListSelection(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup.access$300(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$Handler.itemStateChanged(Unknown Source)
at javax.swing.JComboBox.fireItemStateChanged(Unknown Source)
at javax.swing.JComboBox.selectedItemChanged(Unknown Source)
at javax.swing.JComboBox.contentsChanged(Unknown Source)
at javax.swing.AbstractListModel.fireContentsChanged(Unknown Source)
at javax.swing.DefaultComboBoxModel.setSelectedItem(Unknown Source)
at javax.swing.JComboBox.setSelectedItem(Unknown Source)
at ro.sync.f.g.<init>(Unknown Source)
at ro.sync.f.e.<init>(Unknown Source)
at ro.sync.exml.MainFrame.<init>(Unknown Source)
at ro.sync.exml.MainFrame.<init>(Unknown Source)
... 18 more
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Settings up an external processor

Post by adrian »

Hi,
When I put the saxon8.jar in the \lib folder Oxygen won't open with the following stack:
You are not supposed to do that with Saxon because Oxygen has its own version of Saxon-EE bundled there and yours will interfere with it to the point of completely breaking Oxygen.

You should configure Saxon 8 as a Custom XSLT Processor. You can then configure a transformation scenario and select there your custom XSLT processor from the Transformer combo box.
Note that you cannot use this custom XSLT processor for debugging, only for transformations.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
iceandrews
Posts: 3
Joined: Tue Mar 20, 2018 5:56 pm

Re: Settings up an external processor

Post by iceandrews »

Oh! Ok that makes more sense. I've got it setup as a custom Processor, how do I invoke it? When I pull the processor drop down, I don't see the custom one that I setup...
iceandrews
Posts: 3
Joined: Tue Mar 20, 2018 5:56 pm

Re: Settings up an external processor

Post by iceandrews »

Got it! Is there a way to set it as the default process for any transformations? I found how to setup an specific scenario and it works that way.

I don't see how to access it directly form the XML: XSL: settings in the ribbon. Nor do I see it in the PRocessor dropdown on the "debugger" line. I understand that I can't actively debug with it, but I'm trying to figure out a why so we don't have to setup a new Transformation Scenario every time.
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Settings up an external processor

Post by adrian »

Hi,
Is there a way to set it as the default process for any transformations?
No, there isn't. You have to configure a transformation scenario and select it in the Transformer combo box.
I don't see how to access it directly form the XML: XSL: settings in the ribbon. Nor do I see it in the PRocessor dropdown on the "debugger" line. I understand that I can't actively debug with it, but I'm trying to figure out a why so we don't have to setup a new Transformation Scenario every time.
You seem to have switched to the "XSLT Debugger" perspective. A custom XSLT processor cannot be used in the XSLT debugger. The debugger cannot help you run a transformation without debugging. Even for debugging we recommend creating a scenario first, and debug starting from that.

You don't have to configure a transformation scenario every time, you only need a few scenarios depending on what you have:
- many XMLs that are transformed with one (or few) XSLs. You should open one of the XMLs and create a new scenario of type XML transformation with XSLT, leave the XML URL as ${currentFileURL} and just pick your XSL in the XSL URL. You can then use this same scenario for all XMLs, either one at a time, or as batch in Project view. The scenario remains associated with the XML files.
or
- one (or few) XMLs that are transformed with many XSLs. You should open one of the XSLs and create a new scenario of type XSLT transformation, leave the XSL URL as ${currentFileURL} and just pick your XML in the XML URL. You can then use this same scenario for all XSLs.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply