note 96857 added to domdocument.savexml
| From: | samstah at gmail dot com | Date: | Fri, 19 Mar 2010 11:56:16 +0000 |
| Subject: | note 96857 added to domdocument.savexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167195@lists.php.net to get a copy of this message | ||
We discovered using DOMDocument::saveHTML() that it converts to HTML 4.01 compatible markup; rather
than XHTML. The simple answer is to use saveXML() instead, although this adds the XML declaration to
the top.
To qjerry.com at gmail.com, thanks for the pointer below - but I think that the simplest way seems
to be using:
<?php $domDocument->saveXML($domDocument->documentElement); ?>
Of course, if you're dealing with XHTML, this will strip any <!DOCTYPE> declarations in
the document too.
----
Server IP: 117.55.229.1
Probable Submitter: 203.217.64.85
----
Manual Page -- http://www.php.net/manual/en/domdocument.savexml.php
Edit -- https://master.php.net/note/edit/96857
Del: integrated -- https://master.php.net/note/delete/96857/integrated
Del: useless -- https://master.php.net/note/delete/96857/useless
Del: bad code -- https://master.php.net/note/delete/96857/bad+code
Del: spam -- https://master.php.net/note/delete/96857/spam
Del: non-english -- https://master.php.net/note/delete/96857/non-english
Del: in docs -- https://master.php.net/note/delete/96857/in+docs
Del: other reasons-- https://master.php.net/note/delete/96857
Reject -- https://master.php.net/note/reject/96857
Search -- https://master.php.net/manage/user-notes.php