in reply to Generating XML from a template
I also think HTML::Template will probably do the job. The only thing that might bite you is XML escaping - as the name implies, the module is intended for HTML documents, not XML. But it does support HTML escaping, and that will probably suffice. Here's a little example to get you started.
# file test.pl use HTML::Template; use strict; use warnings; my $template = HTML::Template->new(filename => 'test.tmpl'); # params $template->param(tag1 => '<tag1_test_value>'); $template->param(tag2 => '<tag2_test_value>'); print $template->output(); # file test.tmpl <root> <tag1><TMPL_VAR ESCAPE=HTML tag1></tag1> <tag2><TMPL_VAR ESCAPE=HTML tag2></tag2> </root> # output <root> <tag1><tag1_test_value></tag1> <tag2><tag2_test_value></tag2> </root>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Generating XML from a template
by piyush.shourie (Beadle) on Dec 23, 2004 at 10:39 UTC | |
by edan (Curate) on Dec 23, 2004 at 10:58 UTC |