Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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)

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?
[hippo]: Is the NVIDIA driver problem still a thing?
[zentara]: See problems with Nvidia and Linus Torvalds
[choroba]: that's 2012
[zentara]: I just acquired a computer with the card type, and wondered if it was best to stick with the open-source code or use NVIDIA's proprietary code

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2017-05-26 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?