The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

BW::XML::Out - Simple XML output

SYNOPSIS

  use BW::XML::Out;
  my $errstr;

  my $x = BW::XML::Out->new;
  error($errstr) if (($errstr = $x->error));

METHODS

new

Constructs a new object . . .

element( element, content, options )

Returns an XML element. Can be a start-tag, an end-tag, an empty tag, or a container with or without content.

Returns a string with the XML element. Sets the error string (and returns FAILURE) if there's a problem.

Possible options include:

startTag -- A start-tag, has no content.

endTag -- An end-tag, has no content;

xmlContent -- Do not escape the content;

emptyTag -- An empty tag, has not content, formatted like:

    <element />

attribs -- An array ref of hash refs, like this:

    $out = $x->('element', undef, {
      startTag => TRUE,
      attribs => [
       { Att1 => 'one' },
       { Att2 => 'two }
      ]
    } );

... will return this:

    <element Att1="one" Att2="two">
indent_mul

Setter-getter for the indent_mul property.

indent_level

Setter-getter for the indent_level property.

error

Returns and clears the object error message.

AUTHOR

Written by Bill Weinman <http://bw.org/>.

COPYRIGHT

Copyright (c) 1995-2010 The BearHeart Group, LLC

HISTORY

    2010-03-11 bw 1.6.0 -- released to CPAN as part of BW-Lib
    2009-11-04 bw 1.5   -- documentation update - option xmlContent
    2008-04-23 bw 1.4   -- added noNewline option
    2008-03-30 bw 1.3   -- added some options to element
    2008-03-26 bw 1.2   -- miscellaneous cleanup
    2007-08-13 bw 1.1   -- fixed a zero-vs-defined bug
    2007-07-20 bw 1.0   -- initial release as a BW::* module