diff options
author | Christian Stocker <chregu@php.net> | 2002-03-12 08:24:50 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2002-03-12 08:24:50 +0000 |
commit | 668ade05c6353eccc69ae07dbafa423f3c167a82 (patch) | |
tree | b285ab5bfdf6afbfa9286122c1c3e8cb3f8ac631 /ext/domxml/php_domxml.c | |
parent | 6adb33006b454b0e8da9610fee12a058431c4fa2 (diff) | |
download | php-git-668ade05c6353eccc69ae07dbafa423f3c167a82.tar.gz |
nicer (optional) formated output in dump_mem and dump_mem_file
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index cc6e99f49d..2b797183f7 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -2826,7 +2826,10 @@ PHP_FUNCTION(domxml_dump_mem) DOMXML_PARAM_ONE(docp, id, le_domxmldocp,"|l",&format); if (format) + { + xmlKeepBlanksDefault(0); xmlDocDumpFormatMemory(docp, &mem, &size, format); + } else xmlDocDumpMemory(docp, &mem, &size); @@ -2846,12 +2849,21 @@ PHP_FUNCTION(domxml_dump_mem_file) zval *id; xmlDoc *docp; int file_len, bytes; + int format = 0; int compressmode = 0; char *file; - DOMXML_PARAM_THREE(docp, id, le_domxmldocp, "s|l", &file, &file_len, &compressmode); + DOMXML_PARAM_FOUR(docp, id, le_domxmldocp, "s|ll", &file, &file_len, &compressmode,&format); xmlSetCompressMode (compressmode); - bytes = xmlSaveFile(file,docp); + + if (format) + { + xmlKeepBlanksDefault(0); + bytes = xmlSaveFormatFile(file,docp,format); + } + else + bytes = xmlSaveFile(file,docp); + if (bytes == -1) { RETURN_FALSE; |