[jdom-interest] getMixedContent -> getContent

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu Jun 28 06:42:38 PDT 2001


> BTW, there are many times when I, grinding out the code for 
> yet-another
> damned tree-walk, really, really, *really* want to ignore all that
> extra *cruft*, because all I care about are attributes, elements, and
> text.  I know that preserving accuracy is important, but
> 
> <earth>
>   <sky />
> </earth>
> 
> scans to me as a single child element, and it continually irritates me
> (and requires me to take the time to fix the new folks' 
> mistakes, every
> time, using DOM) that I can't *ignore* the whitespace used for
> formatting around that single interesting child node.  I have to
> discard it on purpose, every time I see it, instead of being able to
> say "ignore anything that isn't ...".

I only have the 10000 mile view of it, but my understanding of the
FilterList implementation allows you to put in filters of your own.
Imagine, no whitespace nodes...

I think an XMLFilter could be stuck in jdom-contrib that could do this for
us, no?

In some example code I did that demonstrated using wrappers instead of an
interface on the core JDOM nodes, I deliberatly only looked for elements
that were of type <whatever> which had the fortunate side effect of ignoring
not only whitespace nodes but anything else in the list I didn't want.
Exactly what you are saying I think.

John Wilson gave me an early release of MinML2 which can be used with
SAXBuilder.  The change he made was to support mixed content but sadly, he
reports, it ignores whitespace nodes.  

;-)




More information about the jdom-interest mailing list