On 5/22/07, Christian Stocker <[EMAIL PROTECTED]> wrote:
I can't answer on your first topic, but the second:
That's how it works also in ext/dom (and IMHO as it's supposed to work),
but the "workaround" is easy:
$r2 = $z->xpath('./*');
Thank for looking and replying.
I have to clarify...
Actually I would expect at least the third example
-------------
$z = clone $x->level1_node1[0];
$r3 = $z->xpath('/*');
print $r3[0]->getName();//prints rootnode
-------------
to print level1_node1. But as well at least to me looks logical even the
second to print level1_node1, because the xpath() method is acalled on the
level1_node1, not the rootnode.
I think that it is incorrect that the object (the xml strcuture) $z is still
treated like the object $x when it comes to Xpath. In fact they are
different object with different structures and the Xpath expressions must
return different results (IMHO).
works as you would expect it.
chregu
--
christian stocker | Liip AG | schoeneggstrasse 5 | ch-8004 zurich
phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.liip.ch/ | [EMAIL PROTECTED] | GnuPG 0x5CE1DECB
Vesselin Kenashkov
P.S. sorry for the double post - reply issue.