<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.xsltprocessor.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'xsltprocessor.setprofiling.php',
    1 => 'XSLTProcessor::setProfiling',
    2 => 'Sets profiling output file',
  ),
  'up' => 
  array (
    0 => 'class.xsltprocessor.php',
    1 => 'XSLTProcessor',
  ),
  'prev' => 
  array (
    0 => 'xsltprocessor.setparameter.php',
    1 => 'XSLTProcessor::setParameter',
  ),
  'next' => 
  array (
    0 => 'xsltprocessor.setsecurityprefs.php',
    1 => 'XSLTProcessor::setSecurityPrefs',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/xsl/xsltprocessor/setprofiling.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="xsltprocessor.setprofiling" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">XSLTProcessor::setProfiling</h1>
  <p class="verinfo">(PHP &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">XSLTProcessor::setProfiling</span> &mdash; <span class="dc-title">Sets profiling output file</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-xsltprocessor.setprofiling-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>XSLTProcessor::setProfiling</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$filename</code></span>): <span class="type"><a href="language.types.singleton.php" class="type true">true</a></span></div>

  <p class="para rdfs-comment">
   Sets the file to output profiling information when processing 
   a stylesheet.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-xsltprocessor.setprofiling-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Path to the file to dump profiling information.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-xsltprocessor.setprofiling-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Always returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-xsltprocessor.setprofiling-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Example profiling output</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Load the XML source<br /></span><span style="color: #0000BB">$xml </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$xml</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'collection.xml'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$xsl </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$xsl</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'collection.xsl'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Configure the transformer<br /></span><span style="color: #0000BB">$proc </span><span style="color: #007700">= new </span><span style="color: #0000BB">XSLTProcessor</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$proc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setProfiling</span><span style="color: #007700">(</span><span style="color: #DD0000">'profiling.txt'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$proc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">importStyleSheet</span><span style="color: #007700">(</span><span style="color: #0000BB">$xsl</span><span style="color: #007700">); </span><span style="color: #FF8000">// attach the xsl rules<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$proc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">transformToDoc</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">firstChild</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">wholeText</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>
     The above code will produce the following information 
     in the profiling file:
    </p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">number               match                name      mode  Calls Tot 100us Avg

    0                   cd                                    2      3      1
    1           collection                                    1      1      1

                         Total                                3      4</pre>
</div>
    </div>
   </div>
  </p>
 </div>


</div><?php manual_footer($setup); ?>