php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53693 transformToDoc, different class
Submitted: 2011-01-08 05:31 UTC Modified: -
Votes:4
Avg. Score:4.0 ± 1.7
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: mat at homedvd dot ca Assigned:
Status: Open Package: XSLT related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mat at homedvd dot ca
New email:
PHP Version: OS:

 

 [2011-01-08 05:31 UTC] mat at homedvd dot ca
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 11:01:30 2019 UTC