Re: [PHP-XML-DEV] getElementsByTagName returns subset if elements are arbitrarily nested
[email protected] (Adam Trachtenberg) Mon, 8 Dec 2003 11:08:34 -0500
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
On Dec 8, 2003, at 10:57 AM, Philip Fletcher wrote:
> foreach($dom->getElementsByTagName('c') as $elem ) {
> echo $elem->getAttribute('name');
> }
>
> Will return only c1. If the closing </b> is moved below the closing of
> "c2", then c1c2 will be returned. This is not what I'd expect (I would
> like 'c1c2c3' as per xpath query '//c' ) - have I misinterpreted the
> w3c
> spec?
This works correctly for me. Maybe you have an old version of libxml2?
-adam
--
adam trachtenberg
[email protected]