Hi, the tutorial for the XML::Simple plugin looks mostly like this:

[% USE xml = XML.Simple( site.xml.products, keyattr = '' ) %]
[% FOREACH product = xml.product %]
  <td>[% product.id %]</td>
  <td>[% product.name %]</td>
  <td>[% product.price %]</td>
[% END %]

This is great when I am using TT2 and an XML file, but what if I want to do it in reverse?

Something like this:
print "Content-type: text/xml\n\n";
$template->process('page.tt2', { product => $product_object });

## page.tt2
[% USE xml = XML.Simple( product , keyattr = '' ) %]
[% xml %]

When I do that I get:
plugin error - File does not exist: at /usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd/Template/Plugin/XML/Simple.pm line 47


This leads me to believe that the plugin is only a one-way transmogrification of XML. Am I believing wrong? Is there access to the XMLout function that I am overlooking?

Oh, and the following doesn't work either:
[% USE xml = XML.Simple %]
[% xml.XMLout( product ) %]

Thanks...

Tosh

--
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to