Page 1 of 1

PHP5's DOM extension and XHTML

Posted: Wed Apr 20, 2005 12:47 pm
by p3x
Hello,

How would I go about using the new DOM extension in PHP5 as a way to find elements by ID from an XHTML page (so not an XML file).

I tried to use getElementById() method, but I simply can't get it to work with XHTML files...

Any ideas?

Posted: Thu Apr 21, 2005 3:03 am
by timvw
is the so-called xhtml really valid xml? might want to validate against the dtd first...

Posted: Thu Apr 21, 2005 4:22 am
by p3x
Doesn't really matter - it should work with normal HTML as well, so non-valid XHTML, I have heard it could be done, but I have no clue how...at least I have a clue, but it doesn't seem to work.

P3x