[jdom-interest] b8 vs. b9-rc2 difference

Jason Hunter jhunter at servlets.com
Tue Apr 22 11:43:58 PDT 2003


Yep, new feature.  :-)  I bet the file has whitespace on disk.  So by
telling the XMLOutputter to add more (and not giving the outputter
permission to trim) you're adding more whitespace than you want.  Try
XMLOutputter's default constructor and it'll work well.  Or keep the
whitespace indicators but tell the outputter to allow trimming.

-jh-

"Robertson, Jason" wrote:
> 
> I haven't tried to find the difference in the code, but with this simple
> program:
> 
>    import org.jdom.*;
>    import org.jdom.input.*;
>    import org.jdom.output.*;
>    import java.io.*;
> 
>    class XMLOutputterTest
>    {
>       private static void main(String[] args)
>          throws JDOMException, IOException
>       {
>          SAXBuilder builder = new SAXBuilder();
>          Document doc = builder.build(new FileInputStream(args[0]));
>          XMLOutputter out = new XMLOutputter("   ", true);
>          out.output(doc, System.out);
>       }
>    }
> 
> I get two very different outputs when using b8
> 
>    C:\XMLOutputterTest>XMLOutputterTest simple.xml
>    <?xml version="1.0" encoding="UTF-8"?>
>    <simple>
>       <xml>
>          <example />
>       </xml>
>    </simple>
> 
> 
>    C:\XMLOutputterTest>
> 
> Versus b9-rc2:
> 
>    C:\XMLOutputterTest>XMLOutputterTest simple.xml
>    <?xml version="1.0" encoding="UTF-8"?>
>    <simple>
> 
> 
>       <xml>
> 
> 
>          <example />
> 
> 
>       </xml>
> 
> 
>    </simple>
> 
> 
>    C:\wsg\prototype\SchemaTest>
> 
> Is this a new feature? :)
> 
> Jason
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list