Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Manipulate xml with libxml

by BaldPenguin (Friar)
on Jun 08, 2005 at 16:24 UTC ( #464744=note: print w/replies, xml ) Need Help??


in reply to Re^2: Manipulate xml with libxml
in thread Manipulate xml with libxml

I confess LibXML doesn't create pretty XML, in fact I normally include variables to strip out the unneccesary whitespace because I send it through XSLT. You can write some kind recursive loop to fix it all or if you are not to worried about speed, send your string to XML::Twig. It has some great pretty_print functionality. I only make the comment about speed because in this you will be effectively parsing your XML twice.

Don
WHITEPAGES.COM | INC

Edit by castaway: Closed small tag in signature

Replies are listed 'Best First'.
Re^4: Manipulate xml with libxml
by mirod (Canon) on Jun 08, 2005 at 16:34 UTC

    As much as it pains me to say this ;--( ... if libxml2 is installed, it might be just as simple to use xmllint --format. And XML::Twig comes with a standalone tool: xml_pp.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-01-24 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?