PHP5's DOM extension and XHTML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
p3x
Forum Newbie
Posts: 9
Joined: Thu Nov 11, 2004 4:35 am

PHP5's DOM extension and XHTML

Post 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?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

is the so-called xhtml really valid xml? might want to validate against the dtd first...
p3x
Forum Newbie
Posts: 9
Joined: Thu Nov 11, 2004 4:35 am

Post 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
Post Reply