[jdom-interest] setIgnoringElementContentWhitespace inoperant ?

Jason Hunter jhunter at xquery.com
Wed Dec 8 15:37:51 PST 2004


Not all whitespace is ignorable.  Ignorability comes from the DTD where 
the parser knows certain sections are element only so the whitespace 
doesn't matter.

Now, if you output from JDOM with a compact format then JDOM will strip 
the whitespace for you.

-jh-

Eric VERGNAUD wrote:
> Hi,
> 
> I'm using jdom 1.0. I have the following code:
> 
>    public static Document ReadDocument(File inFile)
>         throws JDOMException, IOException
>     {
>         SAXBuilder sax = new SAXBuilder();
>          sax.setIgnoringElementContentWhitespace(true);
>          return sax.build(inFile);
>      }
> 
> I use this code to parse a document that has been serialized in pretty
> format. There are plenty of 0x0D 0x0A and 0x20 between the elements.
> I was hoping sax.setIgnoringElementContentWhitespace would clean that up,
> but it's not.
> 
> Am I missing something ?
> 
> Eric
> 
> 
> _______________________________________________
> 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