[jdom-interest] XMLOutputter(Format.getCompactFormat)

Lighton Phiri lighton.phiri at gmail.com
Wed Apr 11 04:25:49 PDT 2012


Hello,

Thanks a lot for the hotfix.

--Phiri


On 11 April 2012 13:15, Rolf Lear <jdom at tuis.net> wrote:
> Hi Phiri.
>
> I found (and fixed) the issue. Also added a test case for it.
>
> Now the question is how to deal with it....
>
> For the moment I have uploaded a 'hotfix' to github:
> https://github.com/downloads/hunterhacker/jdom/jdom-2.x-issue72.zip
>
> I have to think about this some more though. This happens to be a 'big' bug,
> but should I wait a few days.... or should I push it out in a rush?
>
> Rolf
>
>
> On 11/04/2012 6:38 AM, Lighton Phiri wrote:
>>
>> Hello Rolf,
>>
>> Noted. Thank you very much.
>>
>> --Phiri
>>
>>
>>
>> On 11 April 2012 12:35, Rolf Lear<jdom at tuis.net>  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());
>>>>         }
>>>>     }
>>>> }
>>>
>>>
>>>
>>
>



More information about the jdom-interest mailing list