| XML-DTD documentation | view source | Contained in the XML-DTD distribution. |
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
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.
| XML-DTD documentation | view source | Contained in the XML-DTD distribution. |