mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 23:52:16 +01:00
* XSLTProcessor::setParameterの翻訳 * `EN-Revision`をマージコミットのIDに修正 --------- Co-authored-by: 武田 憲太郎 <takeda@youmind.jp>
177 lines
5.0 KiB
XML
177 lines
5.0 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 68e72e60ba0b318e21bb8b4a87abba35adb891c8 Maintainer: takagi Status: ready -->
|
|
<!-- Credits: mumumu,t2aking -->
|
|
<refentry xml:id="xsltprocessor.setparameter" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>XSLTProcessor::setParameter</refname>
|
|
<refpurpose>パラメータの値を設定する</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="XSLTProcessor">
|
|
<modifier>public</modifier> <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 role="XSLTProcessor">
|
|
<modifier>public</modifier> <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>
|
|
<classname>XSLTProcessor</classname> を使った変換のための
|
|
1 つあるいは多くのパラメータの値を設定します。
|
|
もしパラメータがスタイルシートに存在しない場合、無視されます。
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>namespace</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
XSLT パラメータの名前空間 URI を指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
XSLT パラメータのローカル名を指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
XSLT パラメータの新しい値を指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<literal>名前 => 値</literal> の組の配列を指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<simpara>
|
|
引数のいずれかにヌルバイトが含まれている場合、<exceptionname>ValueError</exceptionname>例外が発生します。
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.4.0</entry>
|
|
<entry>
|
|
引数のいずれかにヌルバイトが含まれている場合、<exceptionname>ValueError</exceptionname>例外が発生するようになりました。
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.4.0</entry>
|
|
<entry>
|
|
パラメータの値に、シングルクォートとダブルクォートを同時に含められるようになりました。
|
|
PHP 8.4.0 より前のバージョンでは、警告が発生していました。
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>変換前に所有者を変更する</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$collections = array(
|
|
'Marc Rutkowski' => 'marc',
|
|
'Olivier Parmentier' => 'olivier'
|
|
);
|
|
|
|
$xsl = new DOMDocument;
|
|
$xsl->load('collection.xsl');
|
|
|
|
// 変換の設定を行う
|
|
$proc = new XSLTProcessor;
|
|
$proc->importStyleSheet($xsl); // attach the xsl rules
|
|
|
|
foreach ($collections as $name => $file) {
|
|
// XML ソースをロードする
|
|
$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
|
|
-->
|