Edit report at http://bugs.php.net/bug.php?id=50973&edit=1
ID: 50973
Comment by: valid at example dot com
Reported by: geoffers+phpbugs at gmail dot com
Summary: DOMDocument::saveHTML() should be able to take a
node as an arg
Status: Assigned
Type: Feature/Change Request
Package: DOM XML related
Operating System: *
PHP Version: 5.*, 6
Assigned To: rrichards
Block user comment: N
Private report: N
New Comment:
When this gets fixed, it should also fix
http://bugs.php.net/bug.php?id=39771
Previous Comments:
------------------------------------------------------------------------
[2010-03-05 22:06:34] [email protected]
Rob, what's your opinion on this patch?
------------------------------------------------------------------------
[2010-02-10 18:25:44] geoffers+phpbugs at gmail dot com
http://pastebin.ca/1792855 is a patch for this, based upon saveXML().
There is one notable difference between what I have, based on that, and
what is currently there: the if (mem) within the if (!size) is not
present within saveXML(), and nor as a result in my patch. I presume
that it should either be in both saveXML and saveHTML or neither: any
idea?
And, of course, my prior comment was wrong: it's only saveXML() which
has the argument, not save().
------------------------------------------------------------------------
[2010-02-09 16:00:06] geoffers+phpbugs at gmail dot com
Description:
------------
At the moment DOMDocument::save() and DOMDocument::saveXML() both take
an optional first argument which is a node to serialize;
DOMDocument::saveHTML() and DOMDocument::saveHTMLFile() have no such
option and always serialize the whole file. For cases where HTML
serialization is needed of a specific node, all that can be done is
doing it within PHP code (which is comparatively very slow). As libxml
includes the needed APIs to do this, it doesn't appear to be overly
complex to implement. I'll try to write a patch for this later.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=50973&edit=1