XMLReader: Parsing a !DOCTYPE

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
aaj
Forum Newbie
Posts: 4
Joined: Wed Oct 29, 2008 10:20 pm

XMLReader: Parsing a !DOCTYPE

Post by aaj »

Hey everyone,

I have a fairly simple question. Is it possible to parse a doctype via the xml reader (as in get all the values from it).

If my doctype is:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
then through the reader I can tell that its of type XMLReader::DOC_TYPE and that the node name is html, but I can't seem to find out how to pull down all the properties such as PUBLIC, "-//W3C//DTD XHTML 1.0 Strict//EN" etc.

Any "getAttribute" method doesn't work, readString, readInnerXml, nothing try seems to work.

Any thoughts? Is this even possible?

Thanks a million,
Aaj
Post Reply