Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

xml::twig pretty_print

by anniyan (Monk)
on Oct 27, 2005 at 10:51 UTC ( #503297=perlquestion: print w/ replies, xml ) Need Help??
anniyan has asked for the wisdom of the Perl Monks concerning the following question:

I have done small program using xml::Twig, i have used pretty_print for printing. It has different form of printing like, nice, indented etc. But i dont want any kind of style. I want same form as input with changes given in the program. How to attain this? I tried none but it is not giving what i expected.

Regards,
Anniyan
(CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)

Comment on xml::twig pretty_print
Re: xml::twig pretty_print
by murugu (Curate) on Oct 27, 2005 at 11:25 UTC

    Hi anniyan,

    Up to my knowledge, XML::Twig uses pretty_print=none as default. I dont think there is a way to retain the output alignment style asis in the input. Any way the output is also an valid XML right.

    Regards,
    Murugesan Kandasamy
    use perl for(;;);

Re: xml::twig pretty_print
by mirod (Canon) on Oct 27, 2005 at 12:15 UTC

    You can get the same formating as in the original file by using the keep_spaces => 1 option when you create the twig. Note that this will create #PCDATA (text) elements that contain the whitespaces in your tree.

    Update: I updated the FAQ with this question.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-08-20 15:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (116 votes), past polls