J
Jockser
Hello, I'm trying to set up template toolkit to process a xml file and
poplulate the data elements into a template.
I'm trying to understand the example in O'Reilly's Perl Template Toolkit
book. But I'm not doing something right.
Here is what I'm doing:
I have a file named report.tt
[% USE inventory = XML.Simple('products.xml') -%]
[% FOREACH product = inventory.product.keys.sort;
current = inventory.product.$product -%]
[% current.id %] [% product %]
[%- current.stock | format('%5d') %] units @
[%- current.price | format('%6.2f') -%] =
[%- current.stock * current.price | format('%10.2f') %]
[%- total = total + current.stock * current.price %]
[% END -%]
Total value: [% total | format('%10.2f')%]
I try running this at the command prompt by typing:
tpage report.tt
and I get back:
plugin error - XML.Simple: plugin not found
If I check PPM I do have this installed:
38. XML-Simple [2.14] Easy API to maintain XML (esp config
file~
I don't know if I'm running this correctly by using tpage, or if it all
needs to go into a perlscript some how.
Any help would be appreciated!!
Thanks,
poplulate the data elements into a template.
I'm trying to understand the example in O'Reilly's Perl Template Toolkit
book. But I'm not doing something right.
Here is what I'm doing:
I have a file named report.tt
[% USE inventory = XML.Simple('products.xml') -%]
[% FOREACH product = inventory.product.keys.sort;
current = inventory.product.$product -%]
[% current.id %] [% product %]
[%- current.stock | format('%5d') %] units @
[%- current.price | format('%6.2f') -%] =
[%- current.stock * current.price | format('%10.2f') %]
[%- total = total + current.stock * current.price %]
[% END -%]
Total value: [% total | format('%10.2f')%]
I try running this at the command prompt by typing:
tpage report.tt
and I get back:
plugin error - XML.Simple: plugin not found
If I check PPM I do have this installed:
38. XML-Simple [2.14] Easy API to maintain XML (esp config
file~
I don't know if I'm running this correctly by using tpage, or if it all
needs to go into a perlscript some how.
Any help would be appreciated!!
Thanks,