[Biojava-l] Q. change proposed in AlphabetManager

Thomas Down td2@sanger.ac.uk
Fri, 3 Aug 2001 09:35:17 +0100


On Thu, Aug 02, 2001 at 08:06:41AM +0200, Luca.Toldo@merck.de wrote:
> 
> Dear All,
> I have just noticed that AlphabetManager requires xerces for doing
> DOMParser.

There are a number of areas where BioJava uses XML parsers,
and this is likely to increase further in the future.

> I was wondering if it would be much work changing that to a more flexible
> way so that one could use a DOMParser of choice.
> This is for example described in
> http://www.javacoffeebreak.com/books/extracts/javanutshell3rdedition/
> 
> Currently it is like that:
> 
> import org.apache.xerces.parsers.*;
> 
> [snip code].

Actually, there's a rather simpler solution here.  Sun provide
an API called JAXP (Java API for XML Processing) which offers
an abstraction for contructing SAX and DOM parsers.  You can
drop any JAXP-compliant parser onto your classpath and it should
Just Work.

We used JAXP in early versions of BioJava, but had to stop
because we needed SAX2 and/or DOM level 2 in some places, and
JAXP1.0 didn't support these.  JAXP1.1 has been ready for a while
now (and recent Xerces releases are fully JAXP-1.1 compliant)
so we can fairly easily switch back to using this mechanism.

It would be good to do this before the BioJava 1.2 release.

Would this resolve your issues?

  Thomas.