On 4 November 2011 12:32, veeru reddy <[email protected]> wrote:
> Hi, I am very sorry for posting same question three times, my apologizes to
> every one. Actually I am not a student, And I am trying to convert xml data
> into pdf file for more easy understanding purpose. I tried and I am able to
> print all university's data in pdf. for example my post "help needed in
> template tool kit module", I am facing problem so I asked , I got hint form
> mailing list and according to that one I modified and I succeed. now I need
> to add some more information to the PDF for easy understanding  purpose.
>   In this post" please help me In template toolkit module" My problem is I
> need to add student address and subject names in the pdf. I am already
> printing student name and number e.t.c using template tool kit, by using
> student name and number I need to search and get the address and subject
> names of student. So I posted it as new question , sorry for that. I am
> unable to implement how can i get student address by using name and number.
> I searched all template tool kit modules but I didnt found any solution. so
> I posted in mailing list. so please tel me what should I do now. This is my
> frist time using template and I am new to mailing list. I won't post next
> time like that. I will continue with this.


Have you considered using PDF::API2[1] for this?

It seems to me you are massaging your data from one structure
(xml::simple's hashref) into TT and then converting it into PDF. You
could skip this TT part and write it straight out. Moreover,
re-reading your previous messages, I also wonder if your trying to do
too much with your dataset. Your requirement to 'search and get
address'  sounds like you need to do the kind of lookups that
databases were engineered to handle. XML (love it or hate it) is best
suited for transmitting data. You can search within it, in which case
I'd recommend XML::LibXML[2] so you can unleash find(), findvalue()
and the like, but it sounds like your over-reaching with the tools
your using.

The answer to how you can look-up the address given the student id is
really to store the data in a way you can look it up. So address will
have to have an ID and student will have to have one or more addresses
assigned to them:

                               'student'=>[
                                        {
                                       'name'=>'mikky',
                                        'number'=>'12',
                                        'address_id'=>'123', ***
                                          'semester'=>{
                                                 'Number'=>'1',
                                                 'subjects'=>'7',
                                                  'rank'=>'1'
                                                 }
                                              },


HTH,
Dp.


[1] http://search.cpan.org/~ssimms/PDF-API2-2.019/lib/PDF/API2.pm
[2] http://search.cpan.org/~shlomif/XML-LibXML-1.88/

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

Reply via email to