DocBook 5 Webhelp fails with language attribute
Posted: Mon May 26, 2014 6:39 pm
There is a major conflict between the DocBook 5 Webhelp generation and XSLTHL syntax coloring. If I run either the DocBook Webhelp or DocBook Webhelp - Mobile transformations on DocBook 5 source that contains simple <programlisting>s without attributes, then all is well. As soon as I add the language attribute, <programlisting language="java"> (or any other supported language), Webhelp generation fails with the following error:
This problem is trivial to reproduce. Copy the sample below to a file, open it in Oxygen, and run the two Webhelp transformations on it. Boom. Then remove the language="java" attribute and try again. This time, Webhelp generation succeeds.
Notice that the HTML and XHTML transformations always succeed, with or without the attribute, but syntax coloring does not appear. That's a different issue. Let's get it to stop crashing, then work on getting the syntax coloring to work.
Environment: OS X Mavericks, Oxygen 16.0 build 2014052022. Also reproduced on Oxygen 15.2 build 2014040317, so this is not new with 16.0. On this system, the default system Java is Oracle 1.7.0_51-b13, but Apple Java 1.6.0_65-b14-462-11M4609 is also available. From the System Properties dialog, it looks like Oxygen is using the latter.
Code: Select all
BUILD FAILED
/Applications/oxygen/frameworks/docbook/xsl/com.oxygenxml.webhelp/build_docbook.xml:76: The following error occurred while executing this line:
/Applications/oxygen/frameworks/docbook/xsl/com.oxygenxml.webhelp/build_docbook.xml:111: Fatal error during transformation using /Applications/oxygen/frameworks/docbook/xsl/com.oxygenxml.webhelp/xsl/docbook/mobile/chunk_custom.xsl: Exception in extension function java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal; SystemID: file:/Applications/oxygen/frameworks/docbook/xsl/highlighting/common.xsl; Line#: 71; Column#: -1
Notice that the HTML and XHTML transformations always succeed, with or without the attribute, but syntax coloring does not appear. That's a different issue. Let's get it to stop crashing, then work on getting the syntax coloring to work.
Environment: OS X Mavericks, Oxygen 16.0 build 2014052022. Also reproduced on Oxygen 15.2 build 2014040317, so this is not new with 16.0. On this system, the default system Java is Oracle 1.7.0_51-b13, but Apple Java 1.6.0_65-b14-462-11M4609 is also available. From the System Properties dialog, it looks like Oxygen is using the latter.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<article xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Java Programming Language</title>
<author>
<orgname>Wikipedia</orgname>
</author>
</info>
<section>
<title>Hello World</title>
<para>The traditional Hello world program can be written in Java as:</para>
<programlisting language="java">class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}</programlisting>
<para>Source files must be named after the public class they contain,
appending the suffix .java, for example, HelloWorldApp.java. It must first
be compiled into bytecode, using a Java compiler, producing a file named
HelloWorldApp.class. Only then can it be executed, or launched. The Java
source file may only contain one public class, but it can contain multiple
classes with other than public access and any number of public inner
classes.</para>
</section>
</article>