Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6722551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:27:39+00:00 2026-05-26T09:27:39+00:00

I generated latex template using perl,and complied with MikTeX, its generating pdf. But I

  • 0

I generated latex template using perl,and complied with MikTeX, its generating pdf. But I have some problems. I written script like this

  #!/usr/bin/env perl
     use strict;
     use warnings;
      use XML::Fast;
      use Template;

     my $xml = <<'XML';
              <student>
                 <number>24</number>
                 <education>bachelors</education>
                  <specialization>computers </specialization>
                   <address>
                    <house_number="128"/>
                     <street name="xxxx"/>
                    <proddutoor/>
                    </address>   
                </student>
                <student>
                 <number>23</number>
                  <education>ph.d.</education>
                   <specialization>physics </specialization>
                   <address>
                    <house_number="12"/>
                    <street name="xxxx"/>
                     <kadapa/>
                   </address>
                  </student>
                XML
           my $xml_hash = xml2hash $xml;

          my $template = Template->new();

           my $filename = 'output.tex';
    $template->process(\*DATA, $xml_hash, $filename)
      || die "Template process failed: ", $template->error(), "\n";

    system( "pdflatex $filename" );

       __DATA__
       \documentclass{article}

      \title{Roster}
       \author{pavani}

     \begin{document}
       \maketitle

    [% FOREACH st IN student %]
    Student [% st.number %] is a [% st.specialization %] [% st.degree %] student and          
     his address is[%address%][%house_number%][%street name%].
     [% END %]

     \end{document}

when I run it its generating pdf and printing like this

 student 24 is a computers student and his address is HASH(0x274b27c)
    student 23 is a computers student and his address is HASH(0x274b27c)

but I need to print address also how to get the address element content also like this

        student 24 is a computers student and his address is 
                       house_number="128";
                       street name="xxxx";
                        proddutoor.
         student 23 is a computers student and his address is 
                     house_number="12";
                       street name="xxxx";
                     kadapa.

what should I need to change to print like this in pdf.

2) I have one more question if I am giving input like this XML data its excuting what can I do if I have one file with data same as like this,for example more number of students data in one file. I tried to give file name to variable xml but it’s not working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:27:39+00:00Added an answer on May 26, 2026 at 9:27 am

    You need to use [% st.address.house_number %] and [% st.address.street_name %]. XML::Fast builds nested hashes that mirror the nested tags in your XML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have generated eps figures in MATLAB and am using them in Latex. (Miktex
I wrote a research paper in latex and generated pdf using Kile. Now I
I have a Ruby script that produces a Latex document using an erb template.
I've tried using LaTeX and DocBook for documenting programming tools, to get PDF output.
I am using Dompdf to generate A5 pdf documents from a html template and
I am currently working on some LaTeX document which embeds C# files generated by
I've got bunches of auxiliary files that are generated by code and LaTeX documents
I'm writing an in-house module to generate a small LaTeX PDF. Within the module,
I generated a new form using sean-gen (seam new-form) and added another field to
I generated some of my C# code with an external tool. Each generated class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.