|
Posted by petersprc on 12/05/06 20:28
Hi,
Yes you could use PHP, for example:
foreach ($items as $item) {
ob_start();
require('xml-template.php');
$text = ob_get_contents();
ob_end_clean();
fwrite($sock, $text) or trigger_error('fwrite');
}
You could also build the XML tree programmatically. Some examples here:
http://wiki.cc/php/Dom_build
Isak wrote:
> I need to generate and send multiple xml documents over a socket.
>
> Is it feasible to use php as a templating language for these? How would
> i go about that?
>
> I figure i _could_ make them into 'normal pages' and fetch the contents
> using some http library, but that doesn't sound too elegant. There has
> to be a better way?
>
>
> Thanks,
> Isak
Navigation:
[Reply to this message]
|