xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grigorios Dimitriadis" <grigorisdimitria...@hotmail.com>
Subject SAX2 driver class not found error
Date Fri, 20 Jul 2001 14:27:43 GMT

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

Mime
View raw message