Hello, Attached is a plugin I'm working on that wraps XML::Writer, synopsis below. I was planning to submit it for inclusion in the new Template::XML distribution, Andy are you interested? If so do you want patches against the current version on CPAN or is there a cvs/svn version somewhere to work against? It still needs a proper test script and the error handling checking, etc.
All comments welcome.
=head1 SYNOPSIS
# Load the plugin and set writer options.
[% xw = XML.Writer( DATA_MODE => 1, DATA_INDENT => 2 ); %]
# Create XML document
[%
xw.xmlDecl;
xw.startTag( 'website', id=>'webzone1' );
xw.comment( 'Website description' );
xw.startTag( 'section', name=>'alpha', title=>'The Alpha Zone'
);
xw.dataElement( 'description', 'Hello...' );
xw.emptyTag( 'page', href=>'/foo/bar', title=>'The Foo Page' );
xw.emptyTag( 'page', href=>'/bar/baz', title=>'The Bar Page' );
xw.emptyTag( 'page', href=>'/baz/qux', title=>'The Baz Page' );
xw.endTag;
xw.endTag;
xw.end;
%]
#
# Will produce:
#
<?xml version="1.0"?>
<website id="webzone1">
<!-- Website description -->
<section name="alpha" title="The Alpha Zone">
<description>Hello...</description>
<page href="/foo/bar" title="The Foo Page"/>
<page href="/bar/baz" title="The Bar Page"/>
<page href="/baz/qux" title="The Baz Page"/>
</section>
</website>
cheers,
mark
--
"In the beginning, there was nothing, which exploded."
MARK ADDISON
WEB DEVELOPER
200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4678
F
E [EMAIL PROTECTED]
WWW.ITN.CO.UK
Please Note:
Any views or opinions are solely those of the author and do not necessarily
represent
those of Independent Television News Limited unless specifically stated.
This email and any files attached are confidential and intended solely for the
use of the individual
or entity to which they are addressed.
If you have received this email in error, please notify [EMAIL PROTECTED]
Please note that to ensure regulatory compliance and for the protection of our
clients and business,
we may monitor and read messages sent to and from our systems.
Thank You.
Writer.pm
Description: Writer.pm
