Hi
I like JDOM a lot because of its an easy api.
But i have a real Problem when i want to serialize it with JDOM
I want to use the following method(taken from the JDOM Api
public void output(Document
doc,
java.io.Writer writer)
throws java.io.IOException
This will print the Document to the given Writer.
The following is my Source Code
SAXBuilder b = new SAXBuilder();
// Create the document
Document doc = b.build(new File(xmlsourcepath));
//get the root -Element
Element rootElement = doc.getRootElement();
serialize(doc);
public void serialize(Document doc) throws Exception {
XMLOutputter outputter = new XMLOutputter();
//outputter.setIndentSize(2);
FileWriter writer = new FileWriter(xmlsourcepath);
outputter.ouput(doc,(java.io.Writer)writer);
}
When i want to compile withe the JBuilder i get the following errormessage
"Main.java": Error #: 300 : method ouput(org.jdom.Document, java.io.Writer) not found in class org.jdom.output.XMLOutputter at line 78, column 17
How can this be ? I als took a looks a the sourcecode of Jdom but i couldnt find any mistake
public void output(Document doc, Writer writer)
i could use the DomOutputter to make a org.w3c.dom.Document and then i could serialize it with Xerces but this is overhead..
has any of you got the same probelm.How did you fixed it ?
Thx,
Holger