W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

RE: DOM 3 Core: Overlap with JAXP, Document order of attributes, getChildElementsByTagName, Exceptions

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Tue, 15 May 2001 18:48:20 -0600
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08AC5C@thor.aeathtl.com>
To: "'www-dom@w3.org'" <www-dom@w3.org>
>> getChildElementsByTagName:

>I agree the name is misleading. It should really be called something
>like getDescendantsByTagName(). Now, do we need another method for
>immediate children? I personally think people are really lazy, 

Amen, but then they post a question on svg-developer or some other
forum thinking it is a bug instead of a feature and then need to
be taught how to iterate on nodes.

>the cost of looking for this themselves by walking the list of children is minor
>and there is little hope the implementation can do better. 

If the DOM was local and in-memory, I would agree, but if the DOM is 
out-of-process or a API for a datastore, then the difference could
be pretty substantial.  

Also, it is a place where users who aren't concerned about 
portability will go use implementation specific methods like
selectNode() and selectSingleNode()in MSXML.  Definitely not
suggesting adding calls that require an XPath implementation,
but I would think an audit of the uses of selectNode()
and selectSingleNode() would find that the pattern is almost 
always a tagName and that comparable DOM methods would be
widely used.

> Exceptions:
>That's an interesting idea. I'll forward that one to the WG too.
>Thanks for your input!

I'm not sure what the answer to that one is, but it is a pain.  If you
look at the NIST ECMAScript DOM 1 tests, they were trying to examine
message strings and reading tea leaves to
try to guess what exception was intended.  Of course,
logic was specific to a particular implementation (MSXML) in
a particular locale (US English).  It might be something that is 
specific to the ECMAScript binding, since it doesn't affect Java
Received on Tuesday, 15 May 2001 20:49:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC