note 17607 rejected from ref.domxml by zak

From: Date: Mon, 17 Dec 2001 06:13:15 +0000
Subject: note 17607 rejected from ref.domxml by zak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22972@lists.php.net to get a copy of this message
<p>I would like to know if there is any way to auto-indent the XML file when I add a new node in a docxml object and export the string of the created XML file with dumpmem() function... </p> <br> For example:<br> $new = new_xmldoc("1.0"); $root = $new->add_root("ROOT"); $level1 = $root->new_child("LEVEL-1", ""); $level1->new_child("LEVEL2", ""); $new_xml_file = fopen ("test.xml", "w"); fwrite($new_xml_file, $new->dumpmem()); fclose ($new_xml_file); <br> <p> The result in test.xml file is:<br> <?xml version="1.0"?> <ROOT><LEVEL-1><LEVEL2/></LEVEL-1></ROOT> </p> <p> But I'm needing it like this: <br> <?xml version="1.0"?> <ROOT>      <LEVEL-1>           <LEVEL2/>      </LEVEL-1> </ROOT> </p> Could someone help me on this?!<br> Thanks. Ricardo Jr.

« previous php.notes (#22972) next »