<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<refentry id="function.xsl-xsltprocessor-set-parameter">
 <refnamediv>
  <refname>XSLTProcessor->setParameter()</refname>
  <refpurpose>Set value for a parameter</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <classsynopsis>
   <ooclass><classname>XSLTProcessor</classname></ooclass>
   <methodsynopsis>
    <type>bool</type><methodname>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>
  </classsynopsis>
  <classsynopsis>
   <ooclass><classname>XSLTProcessor</classname></ooclass>
   <methodsynopsis>
    <type>bool</type><methodname>setParameter</methodname>
    <methodparam><type>string</type><parameter>namespace</parameter></methodparam>
    <methodparam><type>array</type><parameter>options</parameter></methodparam>
   </methodsynopsis>
  </classsynopsis>
  <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><xref linkend="function.xsl-xsltprocessor-get-parameter" /></member>
    <member><xref linkend="function.xsl-xsltprocessor-remove-parameter" /></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:"../../../../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
-->