On Wed, 7 Nov 2001, Philip Nelson wrote:

> Does selectNode() stay?

Yes.  I'll try not to break any APIs until we do an XPath 2.0 edition,
or something, that radically changes semantics anyhow.

> I also think evaluate() makes more sense.  I wish that there was a more
> elegant approach than returning Object though.  As Object it seems I'd
> have to first find out if I had a List or not, then additionally cast
> each member of the List to what it may be.  I'll admit to having only
> skimmed the previous comments on this though.

Well, the type of the returned Object will be deterministic.  You'll know
what you get back if you examine your input XPath expression.  Basically,
location-paths return a List of Nodes, while pretty much everything else
returns an object of the appropriate type for that expression.  

So, I think you can avoid lots of 'instanceof' checks.  You *will* have
to cast, though.  But you have to cast items-in-a-list anyhow.

        -bob


_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to