ID:               21477
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Bogus
+Status:           Analyzed
 Bug Type:         DOM XML related
 Operating System: linux; kernel 2.4.18
 PHP Version:      4.3.0
 New Comment:

This is a valid bug, by initial conclusion as to the nature of this bug
was wrong.


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

[2003-01-10 12:54:57] [EMAIL PROTECTED]

You're not in position to decide what is bogus and what is not. This is
bogus.


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

[2003-01-10 12:50:17] [EMAIL PROTECTED]

Thanks for identifying the problem, chregu.
But your comment didn't specify WHICH $root in the sample code was
causing the problem.
Here's an example:
     <?php
     $xml=<<<eot
     <node attr="test"><test>hi</test>
     </node>
     eot;
     $doc = domxml_open_mem($xml);
     $root=$doc->document_element();
     //This won't work:
     //$nodeDump =$doc->dump_node($doc);  
     //This crashes:
     //$nodeDump =$root->dump_node($root);  
     //This works:
     $nodeDump =$doc->dump_node($root); 
     echo htmlentities($nodeDump);
     ?>

I have re-opened the bug for integrity of the bug database:
a bug is not 'Bogus' if PHP crashes due to scripting errors.
For the sake of others who get bitten, this should stay open until
fixed, then set it to 'Closed'.

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

[2003-01-10 11:56:45] [EMAIL PROTECTED]

The error is here:

$nodeContent =$root->dump_node($root); 

$root has to be a DOM_DOCUMENT and in your case it's DOM_ELEMENT.

I'll fix the code, so it will throw an error, if it's not a
DOM_DOCUMENT

chregu



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

[2003-01-10 04:44:37] [EMAIL PROTECTED]

modified bug title to be more specific

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

[2003-01-10 00:35:58] [EMAIL PROTECTED]

Re-opening this bug. I'd be happy to work on it if some dom xml
developers could give me a start.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/21477

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

Reply via email to