|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-09-15 16:38 UTC] cmb@php.net
-Summary: transformToDoc, different class
+Summary: ::transformToDoc() $returnClass param docs
insufficient
-Status: Open
+Status: Verified
-Type: Feature/Change Request
+Type: Documentation Problem
[2021-09-15 16:38 UTC] cmb@php.net
[2023-09-30 11:43 UTC] nielsdos@php.net
-Status: Verified
+Status: Closed
-Assigned To:
+Assigned To: nielsdos
[2023-09-30 11:43 UTC] nielsdos@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
Description: ------------ It would be very helpful to allow transformToDoc to return a custom class instance, which would have to extend DOMDocument of course. The example code provided is simplified. Far better usage could be made from the child DOMDocument class -- this is only an example to illustrate the potential. Test script: --------------- class DOMDocumentYouCanFancyPrint extends DOMDocument { public function __toString() { return "<pre>" . htmlentities( $this->saveXML() ) . "</pre>"; } } ... $processor->registerDocumentClass( "DOMDocumentYouCanFancyPrint" ); echo $processor->transformToDoc( $sourceDOM ); Expected result: ---------------- The expected result would be that the transformToDoc method call returns an instance of DOMDocumentYouCanFancyPrint.