What's wrong with XML/XSL processing in Java 5?

S

Simon Brooke

Yet another silly question, but this just might be the crucial one.

In answer to another of my silly questions, Björn Höhrmann pointed me to
http://home.ccil.org/~cowan/XML/tagsoup/, and as I read down the page I
came across this paragraph:

Warning: TagSoup will not build on Java 5.x or 6.x!
Due to a bug in the versions of Xalan shipped with Java 5.x and 6.x,
TagSoup will not build out of the box.

and that reminded me that every time I've started Eclipse the last couple
of months, I've had a nag warning:

22:34:57,727 0 ERROR [ main ] com.oxygenxml.editor.EditorPlugin - The
expected Xerces version Xerces-J 2.7.1 was not loaded due to the fact
that the version XML4J 4.4.3 is added as an extension to the JVM. This
can cause program malfunction. It is strongly recommended to remove the
Xerces implementation located at:
jar:file:/opt/ibm-java2-i386-50/jre/lib/xml.jar!/org/apache/xerces/impl/Version.class

(if I do remove this jar file, Eclipse won't start at all...)

So, is there actually something wrong with the Xalan and Xerces libraries
shipped with Java 5 (and, specifically, as far as I'm concerned, with
IBM's Java 5), and might this explain why I've suddenly got a lot of
things breaking that were reliable before?

I've kind of assumed that my stuff was breaking because it was old and
crufty and depended on bugs in old XSL implementations, but have I
actually installed buggy libraries with Java 5?

This page: http://java.sun.com/j2se/1.5.0/compatibility.html and this:
http://java.sun.com/j2se/1.5.0/docs/guide/xml/jaxp/JAXP-Compatibility_150.html
acknowledge that there are some incompatibilities between the old
implementations and the new, but claim that the new is better (as one
would hope). I want my stuff to work out-of-the-box with Java 5 - not just
IBM's Java 5, any old Java 5. But is Java 5 actually broken?

--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/
.::;===r==\
/ /___||___\____
//==\- ||- | /__\( MS Windows IS an operating environment.
//____\__||___|_// \|: C++ IS an object oriented programming language.
\__/ ~~~~~~~~~ \__/ Citroen 2cv6 IS a four door family saloon.
 
J

Joseph Kesselman

Simon said:
22:34:57,727 0 ERROR [ main ] com.oxygenxml.editor.EditorPlugin - The
expected Xerces version Xerces-J 2.7.1 was not loaded due to the fact
that the version XML4J 4.4.3 is added as an extension to the JVM. This
can cause program malfunction. It is strongly recommended to remove the
Xerces implementation located at:
jar:file:/opt/ibm-java2-i386-50/jre/lib/xml.jar!/org/apache/xerces/impl/Version.class

This isn't a Xalan/Xerces issue; it's a Java "system class path" issue
combined with the fact that it didn't occur to Sun to rename the
packages before shipping so they could easily be used alongside the
latest Apache versions. Descriptions of the problem appear on Apache's
website.

Having said that: When I'm developing on Eclipse, I use the fact that
modern versions of Eclipse can specify which system JARfiles it wants to
use, and I turn off the JVM's copy of xml.jar. That only affects the
JVMs launched to compile and run the app I'm working on; Eclipse
continues to run on the JVM as normally installed.

(Note that, by definition, the version of Apache code that's bundled
into a JVM will run at least several releases behind the most recent
version posted on Apache itself, just due to product release cycles. The
Apache download will have the most recent bug fixes... and the most
recent bugs. Whether that's an improvement or not depends on which ones
your code happens to be sensitive to.)


I know nothing about TagSoup, so I know nothing about whether there is a
real bug issue in the Xalan code Sun shipped or if it's a deliberate
change (perhaps even a bug fix!) that TagSoup failed to track.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top