DOM Level 3 : XPath

Issue XPathEvaluator-1:

The current "EvaluateAsString", "EvaluateAsNumber" is
pretty cluttered and would only get worse as Schema
datatypes are introduced.

Type coercion can already be expressed within the
XPath expression by using the number(), boolean(), and
string() functions.

So if, for example, you wanted the value of the
highlight attribute as a boolean, you would do
something like:

boolean highlight = ((Boolean)
eval.evaluate("boolean(@highlight)",context,(NamespaceResolver)
context)).boolValue;

I don't think that you could signal the expectation of
a single node in the XPath expression, so that might
have to be done by an additional parameter on the
evaluate call.

Even if the current collection of type-specific
evaluate methods remain, there is a need to have a
generic evaluteAs method.

Active and Static initially confused me.  I associated
Active with the "liveness" of the NodeList returned by
.getElementsByTagName() or .getChildren().  Maybe
NodeSetIterator?

It would seem that StaticNodeSet is a replication of
the NodeList interface.  In some ways, it would be the
conceptual common ancestor of NodeList and
NamedNodeMap.  I don't know what the implications of
adding an NodeSet to the DOM Core and making
NamedNodeMap and NodeList derived interfaces?

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Received on Monday, 25 June 2001 17:28:33 UTC