Hi I have xml file from that using XML::LiBXML I extracted and stored in a hash. after that using template I am generating pdf file. I written script like this

#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use Template; use XML::LibXML::Reader; my $file; open( $file, 'DTC_Specification_transformed.xml'); my $reader = XML::LibXML::Reader->new( IO => $file ) or die ("unab +le to open file"); my %nums; my $num=0; while ($reader->nextElement( 'DATA' ) ) { $num=$num+1; $reader->nextElement( 'Test' ); my $information = $reader->readOuterXml(); $reader->nextElement( 'testinfo' ); my $testnumber = $reader->readOuterXml(); $nums{$infortion}= $testnumber; } print %nums; close($file); my $template = Template->new(); my $filename = 'output.tex'; $template->process(\*DATA, %nums, $filename) || die "Template process failed: ", $template->error(), "\n"; system( "pdflatex $filename" ); __DATA__ \documentclass{article} \title{testinformation of each data} \author{michel\\ \begin{document} \maketitle [% FOREACH st IN test %] DTC number:[% st.test %] \\ test information[% st.testinfo.temperature%] [%st.testinfo.humidity %] [% END %] \end{document}
but it generating pdf file without any information.I tried to print hash %nums it printing like this
$var1={ <test>1<test>'=>'<testinfo> <temperature="23"/> <humidity="80"/> </testinfo> <test>2<test>'=>'<testinfo> <temperature="27"/> <humidity="75"/> </testinfo>........so many tests }
I need to print like this in pdf
testnumber= 1, testinfo: temperature= "23", humidity="80" testnumber= 2, testinfo: temperature= "27", humidity="75"
but it not printing like that, it generating empty pdf . how to print pdf like this.

In reply to pdf file using perl latex template. by veerubiji

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.