php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11067 dumpmem() does not ident, or even make new lines when called
Submitted: 2001-05-23 18:16 UTC Modified: 2004-08-27 10:33 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: paulo at paulo dot com dot br Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.5 OS: linux debian 2.2
Private report: No CVE-ID: None
 [2001-05-23 18:16 UTC] paulo at paulo dot com dot br
When you are making a new xmldoc using domxml functions like $node->new_child() and such, then you try to dumpmem, you get an horrible XML doc. No idents, no breaklines, and you cannot see what is nested!

I know this is not a bug, but this feature is extremely important.
XML should be readable for an human being. But the document appears in a single line!

dumpmem does not change original XML (if any). I mean, if you do not start the XML from the scratch, the original XML reamis idented, and with breaklines and so, as it should be.
thanks a lot for the good work!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 18:19 UTC] derick@php.net
Changing type to feature request.

Derick
 [2002-06-08 10:20 UTC] bigredlinux at yahoo dot com
It is critical to understand that dump_mem now has a parameter for formatting the output.  However, this feature will only work if when the xml was created, the whitespace was stripped.  This is just how the underlying libxml2 library works.  If you have even a single bit of indenting in your domxml object, there is no way to get a nice format on the output.  Since when creating new nodes, they are created without indenting, it is useful to always strip the formatting on the way in.  

The problem is, there is NO way to strip formatting on the way in right now in the php functions domxml_open_*.  However, libxml2 does have this feature and it is just a matter of adding an optional param to both of these php functions and then adding 3 lines of code in php_domxml.c.
 [2004-08-27 10:35 UTC] chregu@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

there are formatting options, which allow to get the XML indented on output
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC