Re: [PHP-XML-DEV] PHP5/DOM: XPath Implementation

[email protected] (Adam Maccabee Trachtenberg) Fri, 1 Oct 2004 12:17:34 -0400 (EDT)
Newsgroups php.xml.dev
Message-ID <[email protected]>
On Thu, 30 Sep 2004, Vivian Steller wrote:

> am i right that the xpath processor won't use the
> MyElem::getChildNodes() or MyElem::getAttribute() to get the right
> nodes for the result?

These methods are totally irrelevant in this context.

> i think the processor would choose the internal libxml function to
> traverse through the dom tree.

Right. It uses its internal set of XPath functions.

> thus, seems to me that all dom (C) functions are statically bound
> and not dynamically at runtime like methods of dynamically built php
> objects. otherwise the output of the MyElem::getChildNodes() func in
> the expample above would be "MyElem Func"?

libxml2 doesn't actually provide a DOM interface. The PHP DOM
extension implements the DOM using lower-level XML manipulation
functions that libxml2 exposes.

When you execute an XPath query, it doesn't use getChildNodes() or
anything like that, at least not in the context (or mental model) that
you're implying.

-adam

-- 
[email protected]
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!