php-doc-en/reference/xsl/xsltprocessor/setparameter.xml
Jakub Vrana 0d604bbc9d Remove <classsynopsis> from methods and fields definitions
PhD uses this context for decisions about links and similar.
It also simplifies the XML

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@322205 c90b9560-bf6c-de11-be94-00142212c4b1
2012-01-13 14:20:43 +00:00

139 lines
3.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="xsltprocessor.setparameter" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::setParameter</refname>
<refpurpose>Set value for a parameter</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>XSLTProcessor::setParameter</methodname>
<methodparam><type>string</type><parameter>namespace</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>bool</type><methodname>XSLTProcessor::setParameter</methodname>
<methodparam><type>string</type><parameter>namespace</parameter></methodparam>
<methodparam><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
Sets the value of one or more parameters to be used in subsequent
transformations with <classname>XSLTProcessor</classname>. If the
parameter doesn't exist in the stylesheet it will be ignored.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>namespace</parameter></term>
<listitem>
<para>
The namespace URI of the XSLT parameter.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
The local name of the XSLT parameter.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The new value of the XSLT parameter.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
An array of <literal>name =&gt; value</literal> pairs. This syntax is
available since PHP 5.1.0.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Changing the owner before the transformation</title>
<programlisting role="php">
<![CDATA[
<?php
$collections = array(
'Marc Rutkowski' => 'marc',
'Olivier Parmentier' => 'olivier'
);
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
foreach ($collections as $name => $file) {
// Load the XML source
$xml = new DOMDocument;
$xml->load('collection_' . $file . '.xml');
$proc->setParameter('', 'owner', $name);
$proc->transformToURI($xml, 'file:///tmp/' . $file . '.html');
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>XSLTProcessor::getParameter</function></member>
<member><function>XSLTProcessor::removeParameter</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->