XSLTProcessor::setProfiling

プロファイル情報の出力ファイルを設定する

説明

public true XSLTProcessor::setProfiling(stringnull $filename)

スタイルシート処理時のプロファイル情報を出力するファイルを設定します。

パラメータ

filename

プロファイル情報を出力するファイルへのパス。

戻り値

常に true を返します。

例1 プロファイル出力の例

<?php
// XML ソースを読み込みます
$xml = new DOMDocument;
$xml->load('collection.xml');

$xsl = new DOMDocument;
$xsl->load('collection.xsl');

// 変換器を設定します
$proc = new XSLTProcessor;
$proc->setProfiling('profiling.txt');
$proc->importStyleSheet($xsl); // xsl ルールをアタッチします

echo trim($proc->transformToDoc($xml)->firstChild->wholeText);
?>

上のコードは、ファイルの処理時に次のような情報を出力します。

number               match                name      mode  Calls Tot 100us Avg

    0                   cd                                    2      3      1
    1           collection                                    1      1      1

                         Total                                3      4