ID:               43260
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dhopkins at mutinydesign dot co dot uk
-Status:           Open
+Status:           Assigned
 Bug Type:         Feature/Change Request
 Operating System: Ubuntu Server
 PHP Version:      5.2CVS-2007-11-12 (snap)
-Assigned To:      
+Assigned To:      rrichards
 New Comment:

IE6 isn't fully XHTML compliant and xml declaration is perfectly
valid.

Assigning to self as support for save options (including ability to
suppress declaration) are currently in progress. Not yet fully
integrated into DOM extension as this requires fairly recent libxml2 to
work.


Previous Comments:
------------------------------------------------------------------------

[2007-11-12 13:22:27] dhopkins at mutinydesign dot co dot uk

Description:
------------
This issue is similar to a similar one posted earlier (
http://bugs.php.net/bug.php?id=31130 ).

Basically, I want to use the DOM functions to return valid XHTML - with
trailing slashes - but the saveHTML method returns HTML 4.0 loose. As
was pointed out in the above post, you can just use the saveXML method
to return valid XHTML. However, there is a big problem with this.

If you have a XHTML document that starts with the xml decleration
<?xml?>, Internet Explorer 6 doesn't read the HTML DTD. The result of
which is a skewed document, various CSS attributes are not supported
etc. You are basically trying to display a HTML document with an XML
doctype.

Currently, I am just trimming the xml decleration off the document,
which I am sure you can appreciate is not a very good solution, but its
the only option.

Is it possible to add a feature that will return XML without the XML
decleration? Or is this really something I need to take up with LibXML?
There are quite a few people moaning about this issue, but so far no
solutions has been provided.

Reproduce code:
---------------
$doc = new DomDocument();
$input = $doc->createElement('input');
$input->setAttribute('type', 'checkbox');
$input->setAttribute('checked', 'checked');
$doc->appendChild($input);
echo $doc->saveXML();

Expected result:
----------------
<input type="checkbox" checked="checked" />

Actual result:
--------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<input type="checkbox" checked />


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43260&edit=1

Reply via email to