W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

Fw: Core XML DOM suggestion

From: Don Park <donpark@quake.net>
Date: Fri, 28 Aug 1998 18:18:21 -0700
Message-ID: <003001bdd2ea$eb7c8b30$2ee044c6@arcot-main>
To: "www-dom" <www-dom@w3.org>
John,

Perhaps what you are interested in is something like this?

public interface NodeEx extends Node {
    ...
    NodeList getChildNodes(NodeFilter filter);
    ...
}

where NodeFilter is defined as

public interface NodeFilter {
    boolean acceptNode (Node node);
}

This type of node filtering works quiet well and encourages reusability as
well.  In Docuverse DOM SDK, I started with NodeTypeFilter and TagNameFilter
to implement getElementsByTagName and found it so useful that I kept adding
more filters like:

CompoundFilter - for combining multiple filters
AttributeFilter - for finding elements with specific attribute values
IdentityFilter - for finding an element with specific ID
NamespaceFilter - for finding all elements with namespace attributes

[Note that NodeEx and NodeFilter interfaces in the DOM SDK are
'experimental' only and not part of the DOM API.]

Don Park

-----Original Message-----
From: JLemire@walldata.com <JLemire@walldata.com>
To: w3c-dom-ig@w3.org <w3c-dom-ig@w3.org>
Date: Friday, August 28, 1998 2:57 PM
Subject: Core XML DOM suggestion


>After reading this WD I don't see how to get an element's sub-elements
>of a certain nodeName.  Although it did suffer from inconsistent return
>type shortcomings, the IE4 model had a way that was both conceptually
>straightforward and just so plain damned handy that I used it all the
>time.  I could like to see the WD altered slightly to glean the best of
>both.  My suggestion is to add a method to Node to use as an alternative
>to the childNodes attribute that would also return a NodeList but
>filtered on nodeName and nodeType:
>
> NodeList filteredChildNodes( in wstring              name,
>                                                      in unsigned short
>type    );
>
>
>also kind of like the cleanliness of IE5's separation of Node and
>NodeList functionality where all iteration is at NodeList versus the
>WD's Node having childNodes and first/last child and first/last sibling.
>
>also like their NodeList's moveTo and moveToNode
>
>
>food for thought
>John Lemire
>Wall Data Incorporated
>
>
>
Received on Friday, 28 August 1998 21:27:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT