Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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
Replies are listed 'Best First'.
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.

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(;;);

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 chilling in the Monastery: (12)
As of 2015-07-31 12:07 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 (276 votes), past polls