Ночной странник

Сообщения: 4050
Благодарности: 83
|
Профиль
|
Сайт
|
Отправить PM
| Цитировать
а это код движка шаблонов с использованием XSLT
PHP код: 
function xml2html($XML, $debug = 0)
{
$XSL = implode ('', file('./xslt/top100.xslt'));
$arguments = array('/_xml' => $XML,'/_xsl' => $XSL);
// Allocate a new XSLT processor
$xh = xslt_create();
// Process the document
$HTML = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
if($debug)
{
header('Content-type: application/xml');
print $XML;
}
else
{
if ($HTML)
{
echo str_replace('&', '&', $HTML);
}
else
{
echo " Sorry, sample.xml could not be transformed by sample.xsl into";
echo " the \$XML variable the reason is that " . xslt_error($xh);
echo " and the error code is " . xslt_errno($xh);
}
}
xslt_free($xh);
}
|
-------
можно практически все, но просто мы это еще не знаем.
главный враг програмиста это копипастинг
За хорошее сообщение не забываем нажимать ссылочку "Полезное сообщение"!
Отправлено: 10:49, 02-10-2005
| #22
|