[jdom-interest] XMLOutputter to the rescue (get/setText)

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Jul 12 08:20:28 PDT 2001


At 3:52 PM +0100 7/12/01, Richard Cook wrote:
>I think java licensing makes it OK for the nuclear bit.
>but data oriented could be fooled by recursion:

No, I don't think they could be fooled. They always get what they ask for.

>  <group>
>    <entry>fred</entry>
>    <entry>jim</entry>
>  </group>
>traversing in a composite like way I find a node with "fred..jim" and nodes
>with "fred" and "jim"

If they ask for the text of a group, they get the text of that group. If they ask for the text of an entry they get the text of that entry. 

The question here really is predictability. If somebody does ask for the text of group what do they expect to get? a string full of white space? or "
    fred
    jim
  "? I think it's the latter. They may be marginally surprised by the line breaks, but that's easy to notice and normalize if it's a concern. 
-- 

+-----------------------+------------------------+-------------------+
| 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