Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

Problems importing SAXParser

Thread view: 
Mikl - 19 Mar 2005 12:11 GMT
Hi

I'm using Netbeans IDE 4.0 and I want to use an XML parser. I've
downloaded Xerces2 from Apache: http://xml.apache.org/xerces2-j/

Now, I want to import different packages. I use:

import org.xml.sax.XMLReader;
import org.apache.xerces.parsers.SAXParser;

Both lines are are autocompleted by Netbeans, but the last line does not
compile. I get this error:

java 12: package org.apache.xerces.parsers. does not exist

I guess I need to include something in the classpath, however I've
included everything I can think of. A screendump of my classpath can be
found here: http://selsoe.homepage.dk/classpath.jpg

When autocompleting the last line, Netbeans shows that no Javadocs exist
for this package - I've tried to add it without luck, but I'm not sure
if it can be the cause of the problem. What puzzles me, is that if
Netbeans can autocomplete it, why doesn't it exist??

/Mikkel
Martin Honnen - 19 Mar 2005 19:25 GMT
> I'm using Netbeans IDE 4.0 and I want to use an XML parser.

Java 1.4 comes with an XML parser, based on Crimson from Apache. And
Java 1.5 comes with an XML parser too, based on Xerces from Apache.

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/

Mikl - 20 Mar 2005 15:00 GMT
>> I'm using Netbeans IDE 4.0 and I want to use an XML parser.
>
> Java 1.4 comes with an XML parser, based on Crimson from Apache. And
> Java 1.5 comes with an XML parser too, based on Xerces from Apache.

Hmm, I've tried to find it put I can only find the one I have already
tried. Could you give me the path?

/Mikkel
Martin Honnen - 21 Mar 2005 17:04 GMT
>> Java 1.4 comes with an XML parser, based on Crimson from Apache. And
>> Java 1.5 comes with an XML parser too, based on Xerces from Apache.
>
> Hmm, I've tried to find it put I can only find the one I have already
> tried. Could you give me the path?

With Java 1.4 or 1.5 you would use the JAXP factory mechanisms with the
classes in javax.xml.parsers e.g. SAXParserFactory, SAXParser.
It is an abstraction layer that allows to use different parsers but it
automatically uses the built-in parser unless certain properties ask for
a different parser to be used.

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.