XML::Genx 0.21 review
DownloadXML::Genx is a simple, correct XML writer. SYNOPSIS use XML::Genx; my $w = XML::Genx->new; eval { # < foo >bar<
|
|
XML::Genx is a simple, correct XML writer.
SYNOPSIS
use XML::Genx;
my $w = XML::Genx->new;
eval {
# < foo >bar< /foo >
$w->StartDocFile( *STDOUT );
$w->StartElementLiteral( 'foo' );
$w->AddText( 'bar' );
$w->EndElement;
$w->EndDocument;
};
die "Writing XML failed: $@" if $@;
This class is used for generating XML. The underlying library (genx) ensures that the output is well formed, canonical XML. That is, all characters are correctly encoded, namespaces are handled properly and so on. If you manage to generate non-well-formed XML using XML::Genx, please submit a bug report.
The API is mostly a wrapper over the original C library. Consult the genx documentation for the fine detail. This code is based on genx beta5.
Requirements:
Perl
XML::Genx 0.21 keywords