[jdom-interest] Problem with save sub element

Edelson, Justin Justin.Edelson at mtvn.com
Wed Sep 13 07:44:13 PDT 2006


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 at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of sam sam
Sent: Tuesday, September 12, 2006 2:49 PM
To: jdom-interest at jdom.org
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@yourhost.com



More information about the jdom-interest mailing list