ID:               43686
 Updated by:       [EMAIL PROTECTED]
 Reported By:      programatorfreez at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Gentoo GNU/Linux
 PHP Version:      5.2.5
 New Comment:

Maybe you should read the docs before stating something is broken:
http://www.php.net/manual/en/function.dom-domdocumentfragment-appendxml.php


Previous Comments:
------------------------------------------------------------------------

[2007-12-27 02:50:09] programatorfreez at gmail dot com

Description:
------------
You're missing a very handful feature and it's pretty annoying to make
a workaround which cannot perform exactly what I need until PHP is
fixed.

Reproduce code:
---------------
This is my crappy workaround for the missing Dom->importString(),
however the support in DOM should be made.

        /**
         * Import a string like something<br /><strong>strong</strong> into
the DomDocument
         *
         * @param  string     string
         * @param  DomElement parent
         * @return DomElement reference to imported node
         */
        public function importString($string, $parent) {
            if ($parent === NULL) {
                throw new Exception('Parent cannot be NULL.');
            }
            
            $tmp = new DomDocument('1.0', 'utf-8');
            
            // The div is unwanted here, but loadXml doesn't work without it
            $tmp->loadXml('<div>' . $string . '</div>');
            return $this->domImportNode($tmp->firstChild);
        }

Actual result:
--------------
PHP DOM doesn't provide any similar functionaly, although it's needed.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43686&edit=1

Reply via email to