RE: [PHP] LIBXML- Auto-Indent - How do it?
| From: | Junior, Ricardo | Date: | Mon, 17 Dec 2001 13:52:19 +0000 |
| Subject: | RE: [PHP] LIBXML- Auto-Indent - How do it? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-77929@lists.php.net to get a copy of this message | ||
The conversion to plain text mail format changed the correct indent that I
need.... I'm needing it like this:
<ROOT>
<LEVEL-1>
<LEVEL2/>
</LEVEL-1>
</ROOT>
Thanks !!!
_________________________________
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions
Phone +55 21 2515 7713
ricardo.junior@bowneglobal.com.br
www.bowneglobal.com.br
-----Original Message-----
From: Junior, Ricardo [mailto:Ricardo.Junior@bowneglobal.com.br]
Sent: Monday, December 17, 2001 10:48 AM
To: 'php-general@lists.php.net'
Subject: [PHP] LIBXML- Auto-Indent - How do it?
Hi All,
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...
For example:
$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);
The result in test.xml file is:
<?xml version="1.0"?>
<ROOT><LEVEL-1><LEVEL2/></LEVEL-1></ROOT>
But I'm needing it like this:
<?xml version="1.0"?>
<ROOT>
<LEVEL-1>
<LEVEL2/>
</LEVEL-1>
</ROOT>
Could someone help me on this?!
Thanks.
_________________________________
Ricardo J. A. Júnior, Software Engineer Trainee
Bowne Global Solutions
Phone +55 21 2515 7713
ricardo.junior@bowneglobal.com.br <mailto:ricardo.junior@bowneglobal.com.br>
www.bowneglobal.com.br <http://www.bowneglobal.com.br/>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net