veeru reddy wrote:
> I am very new to this mailing list so I
> directly replied to you.Thanks in advance.

So don't do that then!!!!

-------- Original Message --------
Subject: Re: [Templates] help needed in template toolkit module
Date: Tue, 1 Nov 2011 21:08:10 +0100
From: veeru reddy <[email protected]>
To: [email protected]

thank you very much for your reply, I am very new to perl and also template
toolkit But its not my homework, and also I am providing what i tried still
now. here is the code I written in perl and template toolkit.

#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
use XML::Simple;
use XML::Fast;
use Template;

my $xml = new XML::Simple;
my $data = $xml->XMLin("data.xml");

#print Dumper($data);
my $template = Template->new();
my $filename = 'output1.tex';
$template->process(\*DATA, $data, $filename)
    || die "Template process failed: ", $template->error(), "\n";
 system( "pdflatex $filename" );
__DATA__

\documentclass[a4paper,leqno,twoside]{article}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{multirow}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{color}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
[% FOREACH st IN university %]
[% st.name %]
[%st.location%]
studentdata:
[% FOREACH student IN st.branch.electronics.student %]
Component type: [%+ student.name +%][%+ student.number +%]
      [% FOREACH semester IN student.semester %]
  [%+ semester.number +%]
  [%+ semester.subjects +%]
  [%+  semester.rank +%]
    [% END %]
 [% END %]
[% END %]

I tried so much and I understand that problem so I explained, and also i
tried using LibXML also to create hash but its also the same format. I
can't understand still what is the problem with input data structure. How
can i get this type of data. I am struggling with this if you suggest me
how to get this data or is there any changes in my for loop or input data
structure. It helps me alot. I am very new to this mailing list so I
directly replied to you.Thanks in advance.


_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to