Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: xml::libxml open, add and save not formatting properly

by gam3 (Curate)
on Mar 23, 2010 at 23:10 UTC ( #830414=note: print w/ replies, xml ) Need Help??


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

You might look at XML::Bare or XML::ED as they are very simple.

-- gam3
A picture is worth a thousand words, but takes 200K.


Comment on Re: xml::libxml open, add and save not formatting properly
Replies are listed 'Best First'.
Re^2: xml::libxml open, add and save not formatting properly
by itsscott (Acolyte) on Mar 23, 2010 at 23:17 UTC
    Looks interesting, unfortunately this projects requirements are to only use xml::libxml Thanks for the feedback!
      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();

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://830414]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-31 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls