Page 1 of 1

Duplicate binding slot assignment error with docbook to pdf

Posted: Fri Jun 09, 2017 9:04 pm
by Doug
Hi. I'm getting a "Duplicate binding slot assignment" error in a transformation to fo:xsl from a modified Docbook 5 schema document running through Apache FOP. There was a previous problem discussed on this forum a couple of months ago for a DITA transformation to pdf. As in that case my transformation worked in Oxygen 18 but not in Oxygen 19. I am using what I think is the latest build, Oxygen 19.0 build 2017042020. I am doing the transformation my docbook to fo:xsl using with Saxon 9.7.0.15. I've configured the transformation through a project scenario. The transformation starts with frameworks/docbook/xsl/fo/docbook_custom.xsl and imports some custom routines for custom elements, many fo/xsl files via profile-docbook.xsl, highlight.xsl which is not imported via profile-docbook.xsl ,and oxygen_custom.xsl

I understood from the previous issue that a bug in Saxon was fixed in the Oxygen build I'm using, but it didn't fix my situation. Two workarounds that was suggested to the user with the DITA problem don't seem applicable in my situation. One, I fixed the one place where I was importing an xsl file twice and, two, I don't find a comparable location relative Docbook to direct my transformation to use an earlier Saxon library. I've tried replacing the Saxon jars with earlier versions in my Oxygen installation directory, but Oxygen won't start up with these, I think because of license issues, and I've tried running the transformation with the other available xslt transformers. With the alternative transformers, I either get different errors due to different function calls, or I can produce an pdf but only with starting with an incomplete Docbook document relative my needs. All the Saxon version HE, PE, and EE, produce the "Duplicate binding slot assignment" error.

Thanks for any help.

Doug

Re: Duplicate binding slot assignment error with docbook to pdf

Posted: Mon Jun 12, 2017 10:29 am
by Radu
Hi Doug,

Please see some answers below:
I'm getting a "Duplicate binding slot assignment" error in a transformation to fo:xsl from a modified Docbook 5 schema document running through Apache FOP. There was a previous problem discussed on this forum a couple of months ago for a DITA transformation to pdf. As in that case my transformation worked in Oxygen 18 but not in Oxygen 19. I am using what I think is the latest build, Oxygen 19.0 build 2017042020.
Just to double check that you are running the latest Oxygen 19.0 version, please look in the Help menu at the "About" dialog, it should list the build ID, if the build ID is "2017042020" or newer, then you should have the fix for the previous reported similar problem.
I am doing the transformation my docbook to fo:xsl using with Saxon 9.7.0.15. I've configured the transformation through a project scenario. The transformation starts with frameworks/docbook/xsl/fo/docbook_custom.xsl and imports some custom routines for custom elements, many fo/xsl files via profile-docbook.xsl, highlight.xsl which is not imported via profile-docbook.xsl ,and oxygen_custom.xsl

I understood from the previous issue that a bug in Saxon was fixed in the Oxygen build I'm using, but it didn't fix my situation. Two workarounds that was suggested to the user with the DITA problem don't seem applicable in my situation. One, I fixed the one place where I was importing an xsl file twice and, two, I don't find a comparable location relative Docbook to direct my transformation to use an earlier Saxon library.
I will need some way to reproduce this on our side. It would be great if you can provide us via email (support@oxygenxml.com) with all your customizations and steps to use them.
I've tried replacing the Saxon jars with earlier versions in my Oxygen installation directory, but Oxygen won't start up with these, I think because of license issues, and I've tried running the transformation with the other available xslt transformers. With the alternative transformers, I either get different errors due to different function calls, or I can produce an pdf but only with starting with an incomplete Docbook document relative my needs. All the Saxon version HE, PE, and EE, produce the "Duplicate binding slot assignment" error.
You should never replace the Saxon JARs from Oxygen with yours because we have various Saxon-specific patches which as you found out will break Oxygen completely.
If you go to the Help menu->Install new add-ons and choose to show add ons from all available sites, there is an add-on called "Saxon 9.6 ..." which you can install. After you do this and restart Oxygen, in the transformation scenario in the "Transformer" combo box you will get a new entry called "Saxon-EE 9.6.0.10" which you can try to use.

Regards,
Radu

Re: Duplicate binding slot assignment error with docbook to pdf

Posted: Mon Jun 12, 2017 7:52 pm
by Doug
Hi Radu,

Thanks for your help. Using the Saxon 9.6.0.10 (External) add-on for my Docbook 5 to pdf transformation with fo xsl and Apache fop solved my "Duplicate binding slot assignment" error. I am left with one problem that you might be able to give me further help with.

First, I should say I am using Oxygen 19.0 Build 2016042020 which should have given me the Saxon fix for the Duplicate binding slot ..." error in order to be able to use the Saxon 9.7... engine. I've confirmed this via the About dialog, repeatedly in fact. So I don't know what that is about. If I can get the 9.6... solution to work completely that will solve my problems but I can send you my transformation code if you are still interested in the "Dup.." error.

What I haven't solved yet is referencing Saxon extension functions with the 9.6.. engine. My transformation uses saxon:transform referencing the namespace "http://saxon.sf.net/" to compile a stylesheet with parameters which in turn uses sql:connect referencing the namespace"http://saxon.sf.net/sql" and declaring sql as in extension-element-prefixes. In my transformation scenario I configure Saxon to use a configuration file wherein I declare the sql extension element. However the file does not seem to be relevant or perhaps do any of the transformation engine configuration options when I use the Saxon 9.6.. engine. When I open the engine transformation options dialog in my scenario the dialog is titled Saxon EE 9.7.0.15 despite that I have selected Saxon-9.6.0.10 (External) as my engine. I believe the sql:connect function is in a saxon9-sql.jar library installed in the Oxygen installation folder lib folder. I don't remember off hand whether that is installed with Oxygen or if I got that from the Saxon site. But I think the problem is with the engine configuration not with the library.

How can I set configuration options when I use the 9.6.. add-on engine?

My transformation to pdf works completely if I comment out my saxon:transform with subsequent call to sql_connect code. But I need this code to access a mysql database for some data.

The contents of my Saxon configuration file which I don't think is getting read is as below:

<configuration xmlns="http://saxon.sf.net/ns/configuration" edition="EE">
<global allowExternalFunctions="true" />
<serialization method="xml" indent="yes" saxon:indent-spaces="4" omit-xml-declaration="yes" xmlns:saxon="http://saxon.sf.net/"/>
<xslt version="0.0">
<extensionElement namespace="http://saxon.sf.net/sql"
factory="net.sf.saxon.option.sql.SQLElementFactory"/>
</xslt>
<xquery version="3.0" allowUpdate="true" preserveNamespaces="false"/>
</configuration>

Thanks,
Doug

P.S. I really enjoyed meeting you and George and other Oxygen colleagues at the Oxygen meet-up outside Wash. D.C. and especially enjoyed dinner with you and all.

Re: Duplicate binding slot assignment error with docbook to pdf

Posted: Tue Jun 13, 2017 2:58 pm
by alex_jitianu
Hi Doug,

My colleague Radu ask me to take a look at this issue. The problem is that the 9.6 addon doesn't contain the saxon9-sql.jar needed to connect to an SQL database. If you start Oxygen from a command line launcher you will probably see a warning about a detected incompatibility. We will release a version of the that will contain this JAR, but until the release here is how you can fix the issue (Oxygen has to be closed before starting the procedure).
1. Go to Options->Preferences on page Plugins. Select the Saxon plugin and, on the bottom, notice the Location where it is installed. Open that directory in a file explorer.
2. In the plugin directory:
- copy the saxon9-sql.jar inside the "lib" sub-directory. You can get this JAR from the Saxon 9.6 package.
- Edit plugin.xml and replace its content with:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!-- The plugin.dtd file is located in the OXYGEN_INSATALL_DIR/plugins directory -->
<!DOCTYPE plugin SYSTEM "../plugin.dtd">

<plugin
id="com.oxygenxml.sdksamples.transformer.Saxon96TransformerPlugin"
name="Saxon-EE 9.6.0.10 (External) Transformer"
description="Saxon-EE 9.6.0.10 (External) Transformer Add-on"
version="${project.nosnapshot.version}"
vendor="SyncRO"
class="com.oxygenxml.sdksamples.transformer.Saxon9TransformerPlugin"
classLoaderType="preferReferencedResources">
<!-- Saxon 9.6 has 3 distributions:
HE - Home edition
PE - Professional edition
EE - Enterprise edition
This variable indicates to the plugin which edition is licensed and should be used. -->
<property name="extension.saxon.edition" value="EE"/>
<runtime>
<librariesFolder name="lib"/>
<library name="lib/"/>
<!-- To distribute a Saxon license, put the saxon-license.lic inside the lib/ folder -->
</runtime>
<extension type="Transformer" class="com.oxygenxml.sdksamples.transformer.Saxon9XSLTTransformerExtension" />
<extension type="XQueryTransformer" class="com.oxygenxml.sdksamples.transformer.Saxon9XQueryTransformerExtension" />
</plugin>
3. Start Oxygen and test the XSLT

Please let me know how it goes!
Best regards,
Alex

Re: Duplicate binding slot assignment error with docbook to pdf

Posted: Wed Jun 14, 2017 8:20 pm
by Doug
Hi Alex,

Your solution worked. Thanks! I apologize for the delay in replying. I was off work for the day yesterday so did not get to get back to this issue until today. It took me a while to discover where the Saxon 9.6 transformer plugin had been installed and thus where to modify the plugin.xml and install the saxon9-sql.jar, in my windows installation, C:\Users\dblack\AppData\Roaming\com.oxygenxml\extensions\v19.0\plugins\https___www.oxygenxml.com_InstData_Addons_default_updateSite.xml\oxygen-sample-plugin-tranformer-saxon-9-6-19.0. I also failed when I used a more recent version of saxon9-sql.jar I had already installed in the Oxygen installation lib folder to copy to the plugin lib installation folder. But when I used the version from the package you recommended everything worked. Also I note the the transformation scenario engine configuration options set via engine configuration dialog do matter despite that the title on the dialog window still says Saxon 9.7...

Doug

Re: Duplicate binding slot assignment error with docbook to pdf

Posted: Thu Jun 15, 2017 8:59 am
by alex_jitianu
Hi Doug,

I'm glad to hear that it worked! Yes, you need the saxon9-sql.jar compatible with version 9.6, In Oxygen we distribute Saxon 9.7 and with it the corresponding version of the saxon9-sql.jar. We will fix the title of the dialog in the next version of Oxygen (it requires changes in Oxygen's inner code).

Best regards,
Alex

Re: Duplicate binding slot assignment error with docbook to pdf

Posted: Mon Oct 02, 2017 3:39 pm
by sorin_carbunaru
Hi,

Just wanted to let you know that the title of the dialog is now properly displayed in 19.1.

More important, now all versions of Saxon External Plugins will allow users to perform transformations with data extracted from a database.

Best wishes,
Sorin Carbunaru
oXygen XML