と を使用stylesheet.xslt
しpaths.xml
て、いくつかの RSS フィードを変換し、それらを新しく作成されたファイルに出力しますfid.xml
このコードは数か月前に正常に機能していたので、今日もう一度アップロードすることにしました。しかし、私は
[2012 年 11 月 22 日 20:30:32 UTC] PHP 致命的なエラー: 行 20 の /home/..../public_html/..../feeder.php で最大実行時間が 30 秒を超えました(行 20 は変換が始まる場所)
<?php
// create an XSLT processor and load the stylesheet as a DOM
$xproc = new XsltProcessor();
$xslt = new DomDocument;
$xslt->load('feeder/stylesheet.xslt'); // this contains the code from above
$xproc->importStylesheet($xslt);
// your DOM or the source XML
$dom = new DomDocument;
$dom -> load('feeder/paths.xml');
// do the transformation
if ($xml_output = $xproc->transformToXML($dom)) {
file_put_contents('fid.xml', $xml_output);
} else {
trigger_error('Oops, XSLT transformation failed!', E_USER_ERROR);
}
?>