[Biojava-l] xml.jar and xerces.jar

Ann Loraine loraine@loraine.net
Fri, 18 Aug 2000 00:42:18 -0700 (PDT)


The problem I reported earlier with building on Windows (w/ JBuilder)
is due to xml.jar and xerces.jar containing different versions of
the org.w3c.dom package.  (level 1 vs. level 2 ???)

For fun I got the source for com.sun.xml classes from Javasoft 
(http://java.sun.com/Download3) and tried building with
the xerces.jar file supplying org.w3c.dom classes.  The result
was a bunch of compile-time errors.

One was: "class com.sun.xml.tree.Doctype.EntityNode should be
declared abstract; it does not define method getLocalName()
in com.sun.xml.Nodebase."

I'm an xml newbie, so I looked at the source and found that
com.sun.xml.Nodebase is an abstract class which implements
org.w3c.dom.Node, which in the Javasoft distribution doesn't
promise a getLocalName() method.  The xerces version does promise
this method (http://xml.apache.org/apiDocs/org/w3c/dom/Node.html)
however and this is why I got the "should be declared abstract" build
error.

This method "getLocalName()" looks like it has something to do
with namespaces.  Is this right?

Anyhow it looks to me like Xerces distributes a more up-to-date
version of org.w3c.dom which is unfortunately not backwards compatible
with the earlier versions used by Javasoft's com.sun.xml packages.
That is, classes that implement interface(s) in the earlier
version will give an error if you try to use them with the
newer versions that promise more methods.

-Ann

---

Ann E. Loraine
http://www.loraine.net