Implements a live collection of elements. This collection is based on the
org.w3c.dom.html.HTMLCollection defined for HTML documents but works
with XML documents.
The collection is defined in terms of a root element and the elements to look
for under this root. Only elements of the specified type are contained in the
collection. Elements are returned by index or by identifier (the id
attribute). The collection is live, meaning that changes to the document tree
are immediately reflected in the collection. The collection is not optimized for
traversing large document trees.
The collection has to meet two requirements: it has to be live, and it has
to traverse depth first and always return results in that order. As such,
using an object container (such as
java.util.Vector ) is expensive on
insert/remove operations. Instead, the collection has been implemented using
three traversing functions. As a result, operations on large documents will
result in traversal of the entire document tree and consume a considerable
amount of time. * * Note that synchronization on the traversed document cannot be achieved.
The document itself cannot be locked, and locking each traversed node is
likely to lead to a dead lock condition. Therefore, there is a chance of the
document being changed as results are fetched; in all likelihood, the results
might be out dated, but not erroneous.
Used to implement both
org.openxml.XMLCollection and
org.openxml.dom.html.HTMLAnchorElementImpl . *
version: $Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $ author: Assaf Arkin See Also: org.w3c.dom.html.HTMLCollection |