Jess, First of all, this discussion is probably better suited to the commons-user mailing list. As far as your specific questions are concerned, getValue() will always return a primitive value (Number, Boolean or String) when applied to DOM. selectSingleNode() will return either a primitive value or a DOM Node. Regards, - Dmitri
Jess Holle <[EMAIL PROTECTED]> wrote: Dmitri Plotnikov wrote: >Jess, > >JXPath has always supported Xalan through JAXP DOM APIs. What you may have >seen in the source code of JXPath is some attempts to optimize JXPath when it >is used specifically in combination with Xalan. You would not be interested in >that optimization, because it would only be applied to static DOM and take >advantage of DTM. > >Try using JXPath and let us know how it works out. > > Dumb question (which I probably figured out last time I tried this stuff, but have no notes/recollection of): Is there an equivalent of Xalan's one-size-fits-all "XObject xobj = xpath.execute(...)" mechanism in JXPath? I'm looking for a CompiledExpression.getValue() that returns an Object for which: 1. I know the various possible return types when this is applied to a DOM. 2. The result is the most appropriate (as per the XPath standard) of the following: * NodeList or NodeIterator -- or something from which I can easily implement one or both of these interfaces * Boolean * Number * String [I assume callers will apply includes castes within their XPath expressions as necessary where they expect a non-node result.] Is there such a beast? The one-API fits all (beans, JDOM, DOM, etc) approach makes this a bit hard for me to decipher. -- Jess Holle
