Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by ikegami (Patriarch)
on Mar 24, 2010 at 00:36 UTC ( [id://830425]=note: print w/replies, xml ) Need Help??


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

xmllint is a tool that uses libxml and comes with it. It's --format option does what you want. All the work appears to be done by a library function htmlSaveFileFormat. You could patch XML::LibXML to expose that function. You're not the first whose wanted a pretty print function from XML::LibXML.

Update: The simplest solution would be to add an optional format argument to $doc->toStringHTML and swap in htmlDocDumpMemoryFormat for htmlDocDumpMemory in that function.

Update: Never mind, htmlDocDumpMemory simply calls htmlDocDumpMemoryFormat with the format option set, and it doesn't help.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-18 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found