[jdom-interest] reading XML

Eugen Kozynin ekozynin at interserv.com.au
Mon Dec 4 22:38:01 PST 2000


I've used XMLOutputter to write down XML file on hard drive. This works
But now I want to read that file back to memory & make some modifications.
I try to do the following:

import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import java.util.*;
import java.io.*;

public class Test {
   public static void main(String[] args) {
      try {
         SAXBuilder b = new SAXBuilder();
         Document doc = b.build(new File("product.xml"));

         // Output as XML to screen
         XMLOutputter outputter = new XMLOutputter();
         outputter.output(doc, System.out);
       } catch (Exception e) {

This code compiles fine but throws following exception:
Exception in thread "main" java.lang.NoClassDefFoundError:
Any ideas why this may happen?

Also, probably there is also some other ways to get XML file back?

Thank you

More information about the jdom-interest mailing list