[Fwd: [jdom-interest] getMixedContent -> getContent]

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Jun 28 12:14:16 PDT 2001


At 6:35 PM +0100 6/28/01, Markus Bernhardt wrote:

>Elliotte Rusty Harold wrote:
>
>>  Longer term, I wonder if there's some way we can add an overloaded
>>  getContent() method that takes some sort of filter object as an
>>  argument, so that users could pass in filters to get only comments,
>>  only text nodes, only text nodes that weren't ignorable white space,
>>  only elements in a certain namespace, etc.
>
>Would like it.
>Isn't the SAXFilter a better place to ignore white spaces ???
>

Only if you want to ignore them in the entire tree and only if you 
actually have a SAXBuilder in place to read from. Neither of those 
may be true. The document could come from DOM or it could be created 
in memory. And you may want to filter different parts of the tree 
differently. For example, you might want to filter an svg:svg element 
embedded in an XHTML element differently than the surrounding XHTML 
markup. Nor are white space filters the only filters you might want.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list