📄 function.xslt-setopt.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Set options on a given xsl processor</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.xslt.html">XSLT Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="internals2.html">PHP at the Core: A Hacker's Guide to the Zend Engine</a></div> <div class="up"><a href="ref.xslt.html">XSLT 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 xsl processor</span></p> </div> <div class="refsect1 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"><b><b>xslt_setopt</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$processor</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$newmask</tt></span> )</div> <p class="para rdfs-comment"> <b>xslt_setopt()</b> sets the options specified by <i><tt class="parameter">newmask</tt></i> on the given <i><tt class="parameter">processor</tt></i>. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">processor</tt></i></span> <dd> <p class="para"> The XSLT processor link identifier, created with <a href="function.xslt-create.html" class="function">xslt_create()</a>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">newmask</tt></i></span> <dd> <p class="para"> <i><tt class="parameter">newmask</tt></i> is a bitmask constructed with the following constants: <ul class="itemizedlist"> <li class="listitem"> <p class="para"> <b><tt>XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</tt></b> - Tell the processor to parse public entities. By default this has been turned off. </p> </li> <li class="listitem"> <p class="para"> <b><tt>XSLT_SABOPT_DISABLE_ADDING_META</tt></b> - 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"> <b><tt>XSLT_SABOPT_DISABLE_STRIPPING</tt></b> - Suppress the whitespace stripping (on data files only). </p> </li> <li class="listitem"> <p class="para"> <b><tt>XSLT_SABOPT_IGNORE_DOC_NOT_FOUND</tt></b> - Consider unresolved documents (the document() function) non-lethal. </p> </li> </ul> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the number of previous mask is possible, <b><tt>TRUE</tt></b> otherwise, <b><tt>FALSE</tt></b> in case of an error. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 <b>xslt_setopt()</b> Example</b></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 him 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"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.xslt-getopt.html" class="function" rel="rdfs-seeAlso">xslt_getopt()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.xslt.html">XSLT Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="internals2.html">PHP at the Core: A Hacker's Guide to the Zend Engine</a></div> <div class="up"><a href="ref.xslt.html">XSLT Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -