You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Grigorios Dimitriadis <gr...@hotmail.com> on 2001/07/20 16:27:43 UTC

SAX2 driver class not found error

Hello,
this may be a newbie question:

I downloaded and ran a code example from the O'Reilly book
"Java and XML" (chapter 3). It uses the Xerces parser (hence
the question to this list). The code demonstrates a simple
parsing of an XML file. I attach both the Java code and the
XML file.

The file compiles fine, but when I run it, I get this error:
Error in parsing:
    SAX2 driver class org.apache.xerces.parsers.SAXParser not found

The problem seems to be in lines 72-74 (upon instantiating the parser).

I tried replacing the line with:
XMLReader parser = new SAXParser();
(and also adding "import org.apache.xerces.parsers.SAXParser;")
This time the parsing starts, but as soon as the first element
is encountered, it exits having problem with the namespace URI
(appears to be null)!
The problem seems to be in the startElement() function (line 240),
and especially in the line:

if (!namespaceURI.equals("")) {

Can you please help me on this?

(I have win98, JDK1.4, got the Xerces-J-bin.2.0.0.alpha.zip file
extracted in xerces-2_0_0_alpha dir, and put c:\xerces~1\xerces.jar
in my classpath).









_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp