<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set options on a given XSLT processor</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.xslt-set-scheme-handlers.html">xslt_set_scheme_handlers</a></div> <div class="next" style="text-align: right; float: right;"><a href="internals2.html">PHP at the Core: A Hacker's Guide</a></div> <div class="up"><a href="ref.xslt.html">XSLT (PHP 4) Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.xslt-setopt" class="refentry"> <div class="refnamediv"> <h1 class="refname">xslt_setopt</h1> <p class="verinfo">(PHP 4 >= 4.3.0)</p><p class="refpurpose"><span class="refname">xslt_setopt</span> — <span class="dc-title">Set options on a given XSLT processor</span></p> </div> <div class="refsect1 description" id="refsect1-function.xslt-setopt-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>xslt_setopt</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$processor</code></span> , <span class="methodparam"><span class="type">int</span> <code class="parameter">$newmask</code></span> )</div> <p class="para rdfs-comment"> <span class="function"><strong>xslt_setopt()</strong></span> sets the options specified by <em><code class="parameter">newmask</code></em> on the given <em><code class="parameter">processor</code></em>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.xslt-setopt-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter"> processor</code></em></span><dd> <p class="para">The <acronym title="eXtensible Stylesheet Language Transformations">XSLT</acronym> processor link identifier, created with <span class="function"><a href="function.xslt-create.html" class="function">xslt_create()</a></span>.</p></dd> </dt> <dt> <span class="term"><em><code class="parameter">newmask</code></em></span> <dd> <p class="para"> <em><code class="parameter">newmask</code></em> is a bitmask constructed with the following constants: <ul class="itemizedlist"> <li class="listitem"> <p class="para"> <strong><code>XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</code></strong> - Tell the processor to parse public entities. By default this has been turned off. </p> </li> <li class="listitem"> <p class="para"> <strong><code>XSLT_SABOPT_DISABLE_ADDING_META</code></strong> - Do not add the meta tag "Content-Type" for HTML output. The default is set during the compilation of the processor. </p> </li> <li class="listitem"> <p class="para"> <strong><code>XSLT_SABOPT_DISABLE_STRIPPING</code></strong> - Suppress the whitespace stripping (on data files only). </p> </li> <li class="listitem"> <p class="para"> <strong><code>XSLT_SABOPT_IGNORE_DOC_NOT_FOUND</code></strong> - Consider unresolved documents (the document() function) non-lethal. </p> </li> </ul> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.xslt-setopt-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the number of previous mask is possible, <strong><code>TRUE</code></strong> otherwise, <strong><code>FALSE</code></strong> in case of an error. </p> </div> <div class="refsect1 examples" id="refsect1-function.xslt-setopt-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-5560"> <p><strong>Example #1 <span class="function"><strong>xslt_setopt()</strong></span> Example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /><br />$xh </span><span style="color: #007700">= </span><span style="color: #0000BB">xslt_create</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// Tell Sablotron to process public entities<br /></span><span style="color: #0000BB">xslt_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">, </span><span style="color: #0000BB">XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Let's also ask it to suppress whitespace stripping<br /></span><span style="color: #0000BB">xslt_setopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">, </span><span style="color: #0000BB">xslt_getopt</span><span style="color: #007700">(</span><span style="color: #0000BB">$xh</span><span style="color: #007700">) | </span><span style="color: #0000BB">XSLT_SABOPT_DISABLE_STRIPPING</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.xslt-setopt-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.xslt-getopt.html" class="function" rel="rdfs-seeAlso">xslt_getopt()</a> - Get options on a given xsl processor</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.xslt-set-scheme-handlers.html">xslt_set_scheme_handlers</a></div> <div class="next" style="text-align: right; float: right;"><a href="internals2.html">PHP at the Core: A Hacker's Guide</a></div> <div class="up"><a href="ref.xslt.html">XSLT (PHP 4) Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>