Lists Home |
Date Index |
> You missed the point of the question which is about the
> difference between the DOM and XPath data models. I know what
> the answer to the question is based on just the XPath data model.
Well, the question asked what DOM nodes are returned by an XPath query. The answer is, none: an XPath expression can only return XPath nodes. Any mapping to DOM nodes is up to the vendor (until the DOM XPath API comes out).
But if you change the question to ask "what is the value of count(foo/text())", then the only possible answer is 1, and any product that says otherwise is non-conformant.
MSXML3, when I last looked, was non-conformant in this respect. (See XSLT Programmer's Reference, 2nd Edition, Wrox Press, page 700).
XML Spy, incidentally, only uses whatever XSLT and XPath processors you configure it to use, it does not have its own. So telling us what answer XML Spy gives, without telling us how it is configured, is rather pointless.
> > Given the following XML in a DOM document
> > <foo>
> > bar
> > <![CDATA[
> > baz
> > ]]>
> > quux
> > </foo>
> > and the following XPath
> > //text()
> > what should be the resulting DOM nodes and why?