in reply to Displaying XML

The easiest way, is probably to use XML::Parser, and when you new it, say:
my $parser = new XML::Parser(Style => "Debug");
When you parse your XML file, or a chunk of XML msg, it will display it in a easy-to-view way, not exactly the way you want, but maybe you will find it is useful.

Replies are listed 'Best First'.
Re: Re: Displaying XML
by mirod (Canon) on Nov 26, 2002 at 05:56 UTC
    The easiest way, is probably to use XML::Parser

    The easiest way is probably to use an XML tool, but probably not XML::Parser, which is too low-level and quirky to be really considered easy to use.

    In this case you could just output the xml without bothering about the formating and then use a pretty-printer, like xml_pp or Tidy.

Re: Re: Displaying XML
by joe++ (Friar) on Nov 26, 2002 at 17:31 UTC
    If you got LibXML installed (gnome) then you can use
    xmllint --format infile.xml
    ...and you get well-formedness checking for free ;-)

    --
    Cheers, Joe