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
but it generating pdf file without any information.I tried to print hash %nums it printing 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}
I need to print like this in pdf$var1={ <test>1<test>'=>'<testinfo> <temperature="23"/> <humidity="80"/> </testinfo> <test>2<test>'=>'<testinfo> <temperature="27"/> <humidity="75"/> </testinfo>........so many tests }
but it not printing like that, it generating empty pdf . how to print pdf like this.testnumber= 1, testinfo: temperature= "23", humidity="80" testnumber= 2, testinfo: temperature= "27", humidity="75"
In reply to pdf file using perl latex template. by veerubiji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |