Re: XMLOutputter(Format.getCompactFormat)
Lighton Phiri <[email protected]> Wed, 11 Apr 2012 12:38:52 +0200
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <CABPDvwKFsS2M5OhbQn2FOHm0fRfv_xmdq9+ha+XNoJSTL7-Faw@mail.gmail.com> |
Hello Rolf, Noted. Thank you very much. --Phiri On 11 April 2012 12:35, Rolf Lear <[email protected]> wrote: > Hi Lighton. > > Hmmm.... it's a bug. So many things going through my head right now.... like > how can that be? > > But, I am stepping through the code, and yes, it's a bug. > > I am (was) certain I had test cases that cover this condition.... but > obviously I don't. > > I am working on it with 'top priority'. > > Rolf > > > On 11/04/2012 5:40 AM, Lighton Phiri wrote: >> >> import java.io.File; >> import java.io.FileWriter; >> import java.io.IOException; >> >> // jdom2 imports >> import org.jdom2.Document; >> import org.jdom2.JDOMException; >> import org.jdom2.input.SAXBuilder; >> import org.jdom2.output.Format; >> import org.jdom2.output.XMLOutputter; >> >> public class FirstRecipeJDOM { >> >> public static void main(String[] args) { >> File XMLFile = new File("file.xml"); >> FileWriter JDOMRawOutputFile = null; >> SAXBuilder builder = new SAXBuilder(); >> >> try { >> Document XMLDocument = builder.build(XMLFile); >> XMLOutputter XMLOutput = new >> XMLOutputter(Format.getCompactFormat()); >> XMLOutput.output(XMLDocument, System.out); >> >> JDOMRawOutputFile = new FileWriter(new >> File("jdom_recipes.xml")); >> XMLOutput.output(XMLDocument, JDOMRawOutputFile); >> } >> catch(IOException ioe) { >> System.out.println(ioe.getMessage()); >> } >> catch(JDOMException jdome) { >> System.out.println(jdome.getMessage()); >> } >> } >> } > > _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]