"Cannot find symbol" error involving JDOM
I am getting a "cannot find symbol" compiler error on:
XMLOutputter outputter = new XMLOutputter(" ", true);
Using the following code:
<pre>
<code>
import org.jdom.*;
import org.jdom.output.XMLOutputter;
public class Stuff {
public static void main(String[] args) {
// Task: Create a new Document that has no
// DocType, but a root element named "rootBeer."
// The root element will have two child elements,
// named "Foo" and "Bar."
// Each element will have the text "Look at me."
Element root = new Element("rootBeer");
Document doc = new Document(root);
Element foo = new Element("Foo");
foo.setText("Look at me.");
root.addContent(foo);
Element bar = new Element("Bar");
bar.setText("Look at me.");
root.addContent(bar);
try{
XMLOutputter outputter = new XMLOutputter(" ", true);
outputter.output(doc, System.out);
} catch (java.io.IOException e){
e.printStackTrace();
}
}
}
</code>
</pre>
I have installed jdom.jar as a library within NetBeans 5.5 IDE and it
seems to recognize JDOM, but according to this site:
http://www.topxml.com/tutorials/main.asp?id=jdom&page=8
This should be valid syntax and yet I am getting this error. What
else should I be doing?
Thanx
Phil