• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

serialization problem with JDOM

Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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();
public void serialize(Document doc) throws Exception {
XMLOutputter outputter = new XMLOutputter();
FileWriter writer = new FileWriter(xmlsourcepath);
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 ?
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic