> Assuming that I have some XML like this
>
> <person>
> <name>mr jones</name>
> <contact>
> <telephone>01234 5678910</telephone>
> </contact>
> </person>
>
> I can create an XML::Smart object using this XML and access
> the values in perl as follows:
>
> $telephoneno = $myxml->{person}->{contact}->{telephone};
>
> If I pass the XML::Smart object into a TT template I would
> expect this to display the telephone number
>
> [% myxml.person.contact.telephone %]
It would seem that TT is getting hung up on Object::Multitype, which is
used by XML::Smart. Have you checked out XML::Simple? It creates a
regular hash, so if you do:
my $person = XMLin($xml);
Then you can have the (normal) perl hash:
my $telephoneno = $person->{contact}->{telephone};
And you should be able use it in your template:
[% person.contact.telephone %]
--
Mark Thomas
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates