[jdom-interest] Re: Radical Suggestion

Alex Rosen arosen at silverstream.com
Sun Jul 28 11:11:55 PDT 2002


Dennis, I have a lot of sympathy for your suggestion when it comes to
creating documents. Basically it sounds like you're suggesting using
namespace declarations instead of namespaces in the API. This is how a lot
of people tend to think of it, and it's not at all inconsistent with XML if
you describe it in that way. However, when reading documents instead of
creating them, this model falls apart. To read a document correctly, you
absolutely want to look at the namespace, not the namespace declaration. In
this case, people who want to do getChild("name") to find a child that's in
the default namespace are simply wrong; it'll work fine most of the time,
but then they'll run in to a document that declares its namespaces
differently but is logically equivalent, and it'll fail. To me this is proof
enough that we've got the right API, even though it may be confusing to
people at first. (I suppose we could support both systems, one for reading
and one for creating, but that seems way worse.)

Alex




More information about the jdom-interest mailing list