php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50973 DOMDocument::saveHTML() should be able to take a node as an arg
Submitted: 2010-02-09 16:00 UTC Modified: 2011-02-18 20:09 UTC
From: geoffers+phpbugs at gmail dot com Assigned: rrichards (profile)
Status: Duplicate Package: DOM XML related
PHP Version: 5.*, 6 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: geoffers+phpbugs at gmail dot com
New email:
PHP Version: OS:

 

 [2010-02-09 16:00 UTC] 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.


Patches

savehtml-node-argument.patch (last revision 2010-08-05 21:36 UTC by geoffers+phpbugs at gmail dot com)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-10 18:25 UTC] 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-03-05 22:06 UTC] pajoye@php.net
-Status: Open +Status: Assigned
 [2010-03-05 22:06 UTC] pajoye@php.net
Rob, what's your opinion on this patch?
 [2010-11-24 10:08 UTC] jani@php.net
-Package: Feature/Change Request +Package: DOM XML related
 [2010-11-28 11:58 UTC] valid at example dot com
When this gets fixed, it should also fix http://bugs.php.net/bug.php?id=39771
 [2011-02-18 20:09 UTC] rrichards@php.net
-Status: Assigned +Status: Duplicate
 [2011-02-18 20:09 UTC] rrichards@php.net
dupe of bug #39771 which was already taken care of
 [2021-05-17 10:55 UTC] gillcovid19 at gmail dot com
The following pull request has been associated:

Patch Name: Add commit ID to build info
On GitHub:  https://github.com/php/doc-base/pull/17
Patch:      https://github.com/php/doc-base/pull/17.patch
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC