Edit report at http://bugs.php.net/bug.php?id=50973&edit=1
ID: 50973 Updated by: paj...@php.net Reported by: geoffers+phpbugs at gmail dot com Summary: DOMDocument::saveHTML() should be able to take a node as an arg -Status: Open +Status: Assigned Type: Feature/Change Request Package: Feature/Change Request Operating System: * PHP Version: 5.*, 6 Assigned To: rrichards New Comment: Rob, what's your opinion on this patch? Previous Comments: ------------------------------------------------------------------------ [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