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

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.

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

Brown::Feeds::Entity::beutify()
$obj_ref->beautify(\$XML);
Parses the output of
($ok, $error) where $ok is 1 on success. $error is a diagnostic error message.
XML::Beautify::indent_str()
$indent_str = $obj_ref->indent_str(); # To retrieve the current value
or
$obj_ref->indent_str("\t"); # To set a new value
Sets or gets the indent str.
($indent_str) if set.
XML::Beautify::rem_cr()
$indent_str = $obj_ref->rem_cr(); # To retrieve the current value
or
$obj_ref->rem_cr(1); # To set a new value
Sets or gets the option to clean CR from XML before re-formatting.
(true) if set.
XML::Beautify::rem_ws()
$indent_str = $obj_ref->rem_ws(); # To retrieve the current value
or
$obj_ref->rem_ws(1); # To set a new value
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.
(true) if set.
XML::Beautify::orig_indent()
$indent_str = $obj_ref->orig_indent(); # To retrieve the current value
or
$obj_ref->orig_indent("\t"); # To set a new value
Sets or gets the original value for the indent incrementer. NB: Beware of setting this.
($indent_str) if set.


beautify().context(), current_element(), in_element() functions from expat. (Related to above about statics)
Thomas Bolioli <Thomas_Bolioli@alumni.adelphi.edu>

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.
