[ANNOUNCE] XML::Genx
by Dominic Mitchell other posts by this author
Dec 5 2004 10:01AM messages near this date
view in the new Beta List Site
Re: XML::SAX::ExpatXS vs recognized_string
|
Bad free() error
& XSLT I've written (yet another) XML generator for Perl. This one is based
around Tim Bray's genx[1] library, so it tries very very hard to only
output well formed XML. Additionally, it only outputs canonical XML,
which is a winner for me because you can use string comparisons in
tests. :-)
An example:
use XML::Genx::Simple;
my $w = XML::Genx::Simple-> new;
eval {
# <root> <foo id="1">bar</foo></root>
$w-> StartDocFile( *STDOUT );
$w-> StartElementLiteral( 'root' );
$w-> Element( foo => 'bar', id => 1 );
$w-> EndElement;
$w-> EndDocument;
};
die "Writing XML failed: $@" if $@;
Available now at your local CPAN:
http://search.cpan.org/dist/XML-Genx
I hope this is useful to someone!
-Dom
[1] http://www.tbray.org/ongoing/When/200x/2004/02/20/GenxStatus
|