[jdom-interest] My remarks about JDOM B9

Bradley S. Huffman hip at a.cs.okstate.edu
Thu Apr 17 09:18:07 PDT 2003


Laurent Bihanic writes:

> phil at triloggroup.com wrote:
> > => textBuffer is now private
> > Well, we overriden flushCharacters() to, when needed, suppress all the empt
> y (blanks) elements found in such a document:
> >      <tag>
> >        <tag2>mydata</tag2>
> >      ...
> > Because of that formating, there is some undesired text between <tag> & <ta
> g2>, which is ignored by most of XML
> > applications. I know that it is an old debate (I remember talks with Eliot 
> and Denis), but we should keep a way to do
> > that, if some people want to.
> 
> Would something like:
>      private void flushCharacters() throws SAXException {
>          flushCharacters(textBuffer.toString());
>          textBuffer.clear();
>      }
>      protected void flushCharacters(String data) throws SAXException {
>          if (data.length() == 0) {
>              previousCDATA = inCDATA;
>              return;
>          }
>          ...
> be OK?

Wouldn't a SAX XMLFilter be a better hammer for this nail?

Brad



More information about the jdom-interest mailing list