sad1sm0
09-13-2008, 11:50 AM
I am creating an extension for DomDocument that allows for specifically custom xhtml output. I used cdata to display the Doctype but I can't validate against it because it's just the declaration. However, the doctype property of the DOMDocument is by default a read-only property. My first question is how do you define a DTD for a document using DOMDocument class. Also, why doesn't php automatically close tags with no content. what i mean is i do this:
$xhtml->documentElement->appendChild($xhtml->createElement('input');
and expect to see source like this:
<input />
instead what i get is :
<input>
how do i tell php that this tag needs to be closed. I thought that this would be automatic but apparently I'm wrong. I tried saving xml and html and the result was the same.
Any help would be appreciated so thanks in advance
$xhtml->documentElement->appendChild($xhtml->createElement('input');
and expect to see source like this:
<input />
instead what i get is :
<input>
how do i tell php that this tag needs to be closed. I thought that this would be automatic but apparently I'm wrong. I tried saving xml and html and the result was the same.
Any help would be appreciated so thanks in advance