[Hampshire] Doctype Declarations in PHP DOM

Top Page

Reply to this message
Author: Mark Johnson
Date:  
To: hampshire
Subject: [Hampshire] Doctype Declarations in PHP DOM
Hi All,
I'm currently messing around with PHP DOMs to output HTML documents.
I've pretty much got it all figured out, but being the pedantic guy I am,
I like to be able to run my code through the HTML Validator [1] to help
iron out any mistakes or syntactic errors. However, at the moment when I
use the saveHTML() or saveXML() methods of the DOM, the code output
doesn't start with a <!DOCTYPE> tag, meaning I have to copy and paste the
code with the relevent DTD into the validator, which is hassle.

Does anyone know if it's possible to define which DTD the DOM should use,
so that it's output with the saveHTML() or saveXML() methods?

Cheers,
Mark