[jdom-interest] [Vote] NoSuchChildException

Elliotte Rusty Harold elharo at metalab.unc.edu
Wed Jul 12 16:35:46 PDT 2000


At 2:52 PM -0700 7/12/00, Wesley Biggs wrote:

>I would make the use case that before I go using a construct like the
>example above, I would have validated the tree against my schema so that I
>know it's good.  (And I would make an additional case that the code in a
>"pure JDOM" validator is going to have to call the getXXX() methods, and the
>speed of validation really counts.)
>

This is not necessarily true. If the schema requires the child 
element, then yes. However what about a schema that allows but does 
not require an element? That's quite common in practice. In a DTD 
it's the effect of elementName? or elementName* in a <!ELEMENT> 
declaration; and of course not all documents have DTDs or schemas.

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list