[jdom-interest] (no subject)

Bradley S. Huffman hip at csa.cs.okstate.edu
Thu May 29 18:59:54 PDT 2003


"Robertson, Jason" writes:

> And as far as checking for null, if my DTD/Schema says that certain elements
> are required, then yes I am really, really sure :) that it's going to be
> there. Isn't that half the point of validation - so you don't have to do it
> in your code? I agree on optional elements/attributes you have to check, but
> that's ok since it's optional. 

Unless someone changes the schema or it's unavialable at the time your wanting
to process your document.

> Getting back to the interfaces, one thing that that confuses me a little bit
> is that the Parent interface's method names do not deal in Children - there
> is no getChild(), it's getContent(). But the Child interface's method names
> do deal with Parents with it's getParent() method. 

Originally I had it getChild(int), but I guess that got changed to 
getContent(int) to be more consistent with addContent, removeContent, etc. 

> And in Element, getChild() returns an Element, but getParent() return a
> Parent. Seems inconsistent, but I fully understand this a tough area!

The now deprecated getChildren/getChild methods where always a bit confusing 
since DOM uses "children" to mean all mixed content, i.e. elements, comments,
text, pi, and so forth, and JDOM had getChildren return a list of only
elements. Consequently users would use getChildren to get a list and then
wonder why all there text nodes.

> If any of this has changed in CVS, my apologies, I'm looking at the nightly
> drop.



More information about the jdom-interest mailing list