¿Cómo puedo crear una plantilla XML en Perl?
Plantilla xml - Perl
Iniciado por
Marco
, mar 07 2014 02:34
Esto también te interesa!
#2
Publicado 07 marzo 2014 - 04:09
Para crear tu plantilla XML usa HTML::Template:
use strict; use warnings; use HTML::Template; my $template_text = <<EO_TMPL; <TMPL_LOOP FILES> <file> <state><TMPL_VAR STATE></state> <timestamp><TMPL_VAR TIME></timestamp> <location><TMPL_VAR LOCATION></location> </file> </TMPL_LOOP> EO_TMPL my $tmpl = HTML::Template->new( scalarref => \$template_text ); $tmpl->param( FILES => [ { state => 'one', time => 'two', location => 'three' }, { state => 'alpha', time => 'beta', location => 'gamma' }, ]); print $tmpl->output;