<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Oct 3, 2006, at 12:38 PM, Zbigniew Lukasiak wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">I found it utterly difficult to deal with the output of $result.as_xml when debugging. Wouldn't it be usefull if there was an option to set some nice formatting there?<BR clear="all"><BR></BLOCKQUOTE><BR></DIV><DIV>I do it like this...</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>if ( $ENV{ 'DEBUG_PRETTY_XML'} ) {</DIV><DIV> require XML::LibXML;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub pretty_xml {</DIV><DIV> my ( $xml ) = @_;</DIV><DIV> return $xml unless $ENV{ 'DEBUG_PRETTY_XML' };</DIV><DIV> my $printer = XML::LibXML->new;</DIV><DIV> return "\n\n".$printer->parse_string( $xml )->toString( 1 )."\n\n";</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You could probably even graft this into HTML::Widget, although I use it for dealing with other kinds of xml too, so I like to keep it separate.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Jason Kohles</DIV><DIV><A href="mailto:email@jasonkohles.com">email@jasonkohles.com</A></DIV><DIV><A href="http://www.jasonkohles.com">http://www.jasonkohles.com</A>/</DIV><DIV>"A witty saying proves nothing." -- Voltaire</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>