[jdom-interest] Bug in SAXHandler: ignorable white space is thrown away

Jason Hunter jhunter at acm.org
Mon Apr 30 23:42:20 PDT 2001


Cool, thanks.  At least someone was coding while I was emailing.  :-)

Elliotte, please verify all is OK.

-jh-

philip.nelson at omniresources.com wrote:
> 
> which would be this I think:
> 
>         /**
>          * <p>
>          * Capture ignorable whitespace as text
>          * </p>
>          *
>          * @param ch <code>[]</code> - char array of ignorable whitespace
>          * @param start <code>int</code> - starting position within array
>          * @param length <code>int</code> - length of whitespace after start
>        * @throws SAXException when things go wrong
>          */
>         public void ignorableWhitespace(char[] ch, int start,int length)
> throws SAXException {
> 
>                 ((Element)stack.peek()).addContent(new String(ch, start,
> length));
>         }
> 
> I added this to my version of SAXHandler which I am modifying to do the
> entity mods we discussed at SDWest.
> 
> > -----Original Message-----
> > From: Jason Hunter [mailto:jhunter at acm.org]
> > Sent: Tuesday, May 01, 2001 12:20 AM
> > To: Elliotte Rusty Harold
> > Cc: jdom-interest at jdom.org
> > Subject: Re: [jdom-interest] Bug in SAXHandler: ignorable
> > white space is
> > thrown away
> >
> >
> > Elliotte Rusty Harold wrote:
> > >
> > > The SAXHandler class used by SAXBuilder does not override this SAX
> > > method:
> > >
> > > public void ignorableWhitespace(char[] ch,
> > >                                 int start,
> > >                                 int length)
> > >                          throws SAXException
> > >
> > > This means that text nodes contained entirely of ignorable
> > white space
> > > are thrown away. For example, when given this document
> >
> > I'll integrate a patch if you submit it.
> >
> > > DOMBuilder exhibits this bug as well, though I'm not sure why.
> >
> > If you figure it out, would be good to have a patch here too.
> >
> > -jh-
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-interest/yo
> uraddr at yourhost.com



More information about the jdom-interest mailing list