Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] setIgnoringElementContentWhitespace inoperant
?

Jason Hunter

2004-12-08

Replies:

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@(protected)
>
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.