xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald_Les...@lotus.com
Subject Re: SAX2 driver class not found error
Date Fri, 20 Jul 2001 15:07:29 GMT

It is a classpath problem. If you are running under JDK 1.3, see
http://xml.apache.org/xalan-j/faq.html#faq-6.




"Grigorios Dimitriadis" <grigorisdimitriadis@hotmail.com> on 07/20/2001
10:27:43 AM

Please respond to general@xml.apache.org

To:   general@xml.apache.org
cc:    (bcc: Donald Leslie/CAM/Lotus)

Subject:  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
(See attached file: contents.xml)(See attached file: SAXParserDemo.java)
---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org





Mime
View raw message