http://www.perlmonks.org?node_id=933312


in reply to Re: errors in printing latex template output
in thread errors in printing latex template output

hi, I tried as you Said like this

open($file, 'formal.xml'); { local $/; my $xml= <$file>; }
it given two errors like $xml and $file requires explicit package and I cleared those errors like this
my $file; my $xml; open($file, 'formal.xml'); { local $/; $xml= <$file>; }
but it doesn't produce any output its just blank pdf with author name. I tried using data dumper to print $xml_hash. but it doesn't contain any student word it number and regarding information in hash.then I think how it will recognize student. and also I tried to print address elements as you said
[%st.address.house_number%]
its also not working. its also printing as before I posted.

Replies are listed 'Best First'.
Re^3: errors in printing latex template output
by jethro (Monsignor) on Oct 24, 2011 at 09:17 UTC

    Sorry, my fault. The "my" in "my $xml= <$file>;" is wrong and should be removed. Your correction should work as well. Did you notice that you use "DTC_Specification_transformed.xml" as filename instead of "formal.xml" in your corrected script?

    Use data::dumper to print out $xml as well just before converting it with xml2hash. If it contains the file contents then at least up to that point the script is working

      yes I corrected it, If I print $xml before converting to xml2hash using data::dumper it printing my original file as it is.But my output is blank pdf with authors name.

        Step by step. What is in the $xml_hash? And what is in the file output.tex?

        * If $xml_hash is empty that means that XML::Fast somehow can't cope with the data you are providing. Check for differences of your input data to your first script with the inline XML

        * If $xml_hash seems sensible and output.tex is empty then the template doesn't fit the data

        * if output.tex seems correct and the pdf is empty than pdflatex has a problem. Call pdflatex by hand and check the error messages