http://qs321.pair.com?node_id=830416


in reply to Re: xml::libxml open, add and save not formatting properly
in thread xml::libxml open, add and save not formatting properly

Looks interesting, unfortunately this projects requirements are to only use xml::libxml Thanks for the feedback!
  • Comment on Re^2: xml::libxml open, add and save not formatting properly

Replies are listed 'Best First'.
Re^3: xml::libxml open, add and save not formatting properly
by Khen1950fx (Canon) on Mar 24, 2010 at 00:43 UTC
    Too bad that you can't use something like XML::Tidy. I tried it, and it returned this:
    <?xml version="1.0" encoding="utf-8"?> <config> <sites> <site> <sitename>www.example.com</sitename> <active>1</active> <rooturl>http://www.example.com.com/</rooturl> <name>Example</name> </site> <site> <sitename>Test entry</sitename> <name /> <rooturl>http://www.test.com.com/</rooturl> <reportname>test report name</reportname> </site> </sites> </config>
    The code that I used:
    #!/usr/bin/perl use strict; use warnings; use XML::Tidy; my $tidy_obj = XML::Tidy->new( 'filename' => '/path/to/xmlfile'); $tidy_obj->tidy(); $tidy_obj->write();