XML::Output - Perl module for writing simple XML documents
use XML::Output; open(FH,'>file.xml'); my $xo = new XML::Output({'fh' => *FH}); $xo->open('tagname', {'attrname' => 'attrval'}); $xo->pcdata('element content'); $xo->close(); close(FH);
XML::Output is a Perl module for writing simple XML documents
XML::Output is a Perl module for writing simple XML document. The following methods are provided.
$xo = new XML::Output;
Constructs a new XML::Output object.
$xo->open('tagname', {'attrname' => 'attrval'});
Open an element with specified name (and optional attributes)
$xo->close;
Close an element
$xo->empty('tagname', {'attrname' => 'attrval'});
Insert an empty element with specified name (and optional attributes)
$xo->pcdata('element content');
Insert text
$xo->comment('comment text');
Insert a comment
print $xo->xmlstr;
Get a string representation of the constructed document
XML::DTD
Brendt Wohlberg <wohl@cpan.org>
Copyright (C) 2004-2010 by Brendt Wohlberg
This library is available under the terms of the GNU General Public License (GPL), described in the GPL file included in this distribution.
To install XML::DTD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::DTD
CPAN shell
perl -MCPAN -e shell install XML::DTD
For more information on module installation, please visit the detailed CPAN module installation guide.