Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Bitflux:
GetElementById Pitfalls
Jul 02, 2004 @ 10:47:10

Via chegru of bitflux

We get a lot of complaints on bugs.php.net and the mailinglists, that getElementById() doesn't work in the DOM implementation. This is of course wrong, the implementation just works fine ;) But contrary to popular believe, getElementById() does not return the element with the matching attribute named "id" by default.

Therefore I wrote a little article about the whole problem and an easy solution with the recent introduction of the xml:id support in libxml2. As it's a wiki page, feel free to add your additions and corrections.

tagged:

Link:


Trending Topics: