This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Dom sample program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Dom sample program" Watch "Dom sample program" New topic
Author

Dom sample program

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
Hi,
I downloaded Jaxp1.0.1 and tried to run sun DOM sample program. It gave the following error.
C:\jaxp1.0.1>java DomEcho01 slidesample01.xml
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/tree/XmlDocument
Should I install something else?
Please help
Simon
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Simon,
You need to add the jaxp.jar and parser.jar to your CLASSPATH. Assuming you installed JAXP in c:\jaxp1.0.1, then you need to add the following to your CLASSPATH.
set CLASSPATH=c:\jaxp1.0.1\jaxp.jar;c:\jaxp1.0.1\parser.jar;
-Peter
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
hi, Peter,
I did add the classpath. In fact, Sax program runs OK, but DOM does not.
Could you figure out for me? Thanks,
Simon
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
I did not restart my computer. Now it works!
Thanks,
Simon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dom sample program
 
Similar Threads
how to use DOM Parser
DOM parser
DOMTree
combining 2 dom trees
tomcat installation problem