Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

RE: [jdom-interest] Problem with save sub element

Edelson, Justin

2006-09-13


Other than this line:
> out.toString();
which appears unnecessary, there doesn't seem to be anything wrong with
the way you're outputting the Document.

I suspect the issue is how you're assembling the Document, not how
you're outputting it.



-----Original Message-----
From: jdom-interest-bounces@(protected)
[mailto:jdom-interest-bounces@(protected)
Sent: Tuesday, September 12, 2006 2:49 PM
To: jdom-interest@(protected)
Subject: [jdom-interest] Problem with save sub element

Hi,

I worked with JDOM und like it very well, but I have a problem with
saving
into xml the sub element.
I can add an Element and save it but when I add sub element it will
saved as
an Element.
Please help me!!

Hier is a part of my code that save the xml file:



public void save(String filename)
 {
   try
   {

     XMLOutputter out = new
XMLOutputter(org.jdom.output.Format.getPrettyFormat());

      FileWriter writer = new FileWriter(filename);
      out.toString();
         out.output(document, writer);
         writer.flush();
         writer.close();
    }
   catch (java.io.IOException e){}
 }

Thank you

Sam


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.