Thomas Bolioli > XML-Beautify-0.05 > XML::Beautify

Download:
XML-Beautify-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 0.05   Source  

NAME ^

XML::Beautify - Beautifies XML output from XML::Writer (soon to do any XML).

SYNOPSIS ^

        B<WARNING:> This is Alpha Software. The interface is still subject to change. Oh, and keep backups, Doh!!!
        B<WARNING:> This does not do well with already indented and formatted XML. I am still working on that. I am currently just reprinting the original string with E<additional whitespace>. I need to fix this by actually rewriting the XML from the element level on down using something like XML::Writer but adding in the whitespace. See E<recursive...>, Doh!

        use XML::Beautify qw(:const); # imports three constants (YES,NO,FULL)
        $obj_ref = XML::Beautify->new();
        $cleanXML = $obj_ref->beautify(\$XMLstr);
        
        B<NB:> This uses Log::AndError for error handling and logging functions. 
        This is imported as an @ISA and so anything you can do there you can do here.

DESCRIPTION ^

Beautifies (converts to tree format) XML output from XML::Writer (soon to do any XML) to facilitate debugging XML or XML::Writer output.

METHODS ^

beautify()

Brown::Feeds::Entity::beutify()

Usage:
        $obj_ref->beautify(\$XML);
Purpose:

Parses the output of

Returns:

($ok, $error) where $ok is 1 on success. $error is a diagnostic error message.

indent_str()

XML::Beautify::indent_str()

Usage:
        $indent_str = $obj_ref->indent_str();  # To retrieve the current value
        or
    $obj_ref->indent_str("\t"); # To set a new value
Purpose:

Sets or gets the indent str.

Returns:

($indent_str) if set.

rem_cr()

XML::Beautify::rem_cr()

Usage:
        $indent_str = $obj_ref->rem_cr();  # To retrieve the current value
        or
    $obj_ref->rem_cr(1); # To set a new value
Purpose:

Sets or gets the option to clean CR from XML before re-formatting.

Returns:

(true) if set.

rem_ws()

XML::Beautify::rem_ws()

Usage:
        $indent_str = $obj_ref->rem_ws();  # To retrieve the current value
        or
    $obj_ref->rem_ws(1); # To set a new value
Purpose:

Sets or gets the option to clean whitespace (Outside of char and cData) from XML before re-formatting. NB: This will remove blank whitespace from char sections if that is all that the char data contains.

Returns:

(true) if set.

orig_indent()

XML::Beautify::orig_indent()

Usage:
        $indent_str = $obj_ref->orig_indent();  # To retrieve the current value
        or
    $obj_ref->orig_indent("\t"); # To set a new value
Purpose:

Sets or gets the original value for the indent incrementer. NB: Beware of setting this.

Returns:

($indent_str) if set.

HISTORY ^

See Changes file in distribution

TODO ^

AUTHOR ^

Thomas Bolioli <Thomas_Bolioli@alumni.adelphi.edu>

COPYRIGHT ^

Copyright (c) 2001 Thomas Bolioli. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

syntax highlighting: