End of the story, solution and apologies...( Re: How to use a Smarty variable outside the template file ?)
| From: | Luc Saint-Elie | Date: | Tue, 24 Jul 2001 19:03:54 +0000 |
| Subject: | End of the story, solution and apologies...( Re: How to use a Smarty variable outside the template file ?) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1279@lists.php.net to get a copy of this message | ||
Hello,
For those fed up WITH MY XML problem I've a good news, every thing is fine and by the way (as usual) Smarty is absolutely innocent.
In case this could help someone using the same set, to use Smarty variable in a XML file processed with phpxml (www.phpxml.org) then sent to a Smarty templates, le code is :
$file = 'foo.xml';
$xml_data = $tpl->fetch($file); // to have Smarty process the XML file and replacing placeholders with real values
$xml = new XML(); // without mention if the file
$xml->load_string ($xml_data); // to feed phpxml with the "fetched" string
The performance is a little bit slower (normal with to parsing) but this works perfectly well
Apologies , apologies, apologies...
Luc