Added translation of XSL by Mikhail Baranov

git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@316921 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Andrey S. Bezrukov
2011-09-18 09:54:22 +00:00
parent f7bf8c995c
commit fcbc6ad7ca
17 changed files with 1541 additions and 0 deletions

47
reference/xsl/book.xml Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: ac04b2ea214243eaef651b87216b9841d13cd492 Maintainer: aur Status: ready -->
<!-- Reviewed: no -->
<!-- $Revision: $ -->
<!-- Membership: bundled, external -->
<book xml:id="book.xsl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>XSL</title>
<!-- {{{ preface -->
<preface xml:id="intro.xsl">
&reftitle.intro;
<para>
XSL расширение реализует XSL стандарты, поведение <link
xlink:href="&url.xslt;">XSLT трансформации</link> при использовании <link
xlink:href="&url.libxslt;">библиотеки libxslt</link>
</para>
</preface>
<!-- }}} -->
&reference.xsl.setup;
&reference.xsl.constants;
&reference.xsl.examples;
&reference.xsl.xsltprocessor;
</book>
<!-- 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
-->

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<section xml:id="xsl.installation" xmlns="http://docbook.org/ns/docbook">
&reftitle.install;
<para>
PHP 5 содержит расширение XSL по умолчанию. Расширение может быть активировано
добавлением аргумента <option role="configure">--with-xsl[=DIR]</option>
в строку конфигурации. <literal>DIR</literal> - путь установки libxslt.
</para>
</section>
<!-- 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
-->

105
reference/xsl/constants.xml Normal file
View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<appendix xml:id="xsl.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
&extension.constants;
<variablelist>
<varlistentry>
<term>
<constant>XSL_CLONE_AUTO</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>XSL_CLONE_NEVER</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>XSL_CLONE_ALWAYS</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>LIBXSLT_VERSION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
версия libxslt формата 10117. Доступна с PHP 5.1.2.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>LIBXSLT_DOTTED_VERSION</constant>
(<type>string</type>)
</term>
<listitem>
<simpara>
версия libxslt формата 1.1.17. Доступна с PHP 5.1.2.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>LIBEXSLT_VERSION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
версия libexslt формата 813. Доступна с PHP 5.1.2.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>LIBEXSLT_DOTTED_VERSION</constant>
(<type>string</type>)
</term>
<listitem>
<simpara>
версия libexslt формата 1.1.17. Доступна с PHP 5.1.2.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</appendix>
<!-- 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
-->

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 79dcbe011fb254dcd92c597064571fe313362a09 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<chapter xml:id="xsl.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="xsl.examples-collection">
<title>Файлы collection.xml и collection.xsl для примеров</title>
<para>
Многие примеры в этом разделе документации содержат оба файла: XML и XSL.
Мы будем использовать <filename>collection.xml</filename> и
<filename>collection.xsl</filename> со следующим содержанием:
</para>
<para>
<example>
<title>collection.xml</title>
<programlisting role="xml">
<![CDATA[
<collection>
<cd>
<title>Fight for your mind</title>
<artist>Ben Harper</artist>
<year>1995</year>
</cd>
<cd>
<title>Electric Ladyland</title>
<artist>Jimi Hendrix</artist>
<year>1997</year>
</cd>
</collection>
]]>
</programlisting>
</example>
<example>
<title>collection.xsl</title>
<programlisting role="xml">
<![CDATA[
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="owner" select="'Nicolas Eliaszewicz'"/>
<xsl:output method="html" encoding="iso-8859-1" indent="no"/>
<xsl:template match="collection">
Hey! Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection!
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="cd">
<h1><xsl:value-of select="title"/></h1>
<h2>by <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2>
<hr />
</xsl:template>
</xsl:stylesheet>
]]>
</programlisting>
</example>
</para>
</section>
</chapter>
<!-- 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
-->

60
reference/xsl/setup.xml Normal file
View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 383b579aef7ccf8e553603db99fd3c4a89bddabe Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<chapter xml:id="xsl.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.setup;
<!-- {{{ Requirements -->
<section xml:id="xsl.requirements">
&reftitle.required;
&libxml.required;
<para>
Это расширение использует <productname>libxslt</productname>, который может быть
найден на <link xlink:href="&url.libxslt;">&url.libxslt;</link>. Необходима версия libxslt
1.1.0, или выше.
</para>
</section>
<!-- }}} -->
<!-- {{{ Installation -->
&reference.xsl.configure;
<!-- }}} -->
<!-- {{{ Configuration -->
<section xml:id="xsl.configuration">
&reftitle.runtime;
&no.config;
</section>
<!-- }}} -->
<!-- {{{ Resources -->
<section xml:id="xsl.resources">
&reftitle.resources;
&no.resource;
</section>
<!-- }}} -->
</chapter>
<!-- 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
-->

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 4724b47c25b48f509355d27291aa6893ad0b40c0 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.xsltprocessor" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Класс XSLTProcessor</title>
<titleabbrev>XSLTProcessor</titleabbrev>
<partintro>
<!-- {{{ XSLTProcessor intro -->
<section xml:id="xsltprocessor.intro">
&reftitle.intro;
<!-- FIXME: Add class description -->
<para>
Описание класса.
</para>
</section>
<!-- }}} -->
<section xml:id="xsltprocessor.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>XSLTProcessor</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.xsltprocessor')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.xsl.entities.xsltprocessor;
</phpdoc:classref>
<!-- 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
-->

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::__construct</refname>
<refpurpose>Создаёт новый экземпляр класса XSLTProcessor</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<constructorsynopsis>
<methodname>__construct</methodname>
<void/>
</constructorsynopsis>
</classsynopsis>
<para>
Создаёт новый экземпляр класса <classname>XSLTProcessor</classname>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Создаёт <classname>XSLTProcessor</classname></title>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$doc->load($xsl_filename);
$xsl->importStyleSheet($doc);
$doc->load($xml_filename);
echo $xsl->transformToXML($doc);
?>
]]>
</programlisting>
</example>
</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
-->

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.getparameter" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::getParameter</refname>
<refpurpose>Возвращает значение параметра</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>string</type>
<methodname>getParameter</methodname>
<methodparam><type>string</type><parameter>namespaceURI</parameter></methodparam>
<methodparam><type>string</type><parameter>localName</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Возвращает параметр, если он раньше установлен с помощью
<function>XSLTProcessor::setParameter</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>namespaceURI</parameter></term>
<listitem>
<para>
Пространство имён URI параметра XSLT.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>localName</parameter></term>
<listitem>
<para>
Локальное имя параметра XSLT.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Значение параметра, или &null;, если оно не установлено.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>XSLTProcessor::setParameter</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
-->

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.hasexsltsupport" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>XSLTProcessor::hasExsltSupport</refname>
<refpurpose>Определяет имеет ли PHP поддержку EXSLT</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>bool</type>
<methodname>hasExsltSupport</methodname>
<void/>
</methodsynopsis>
</classsynopsis>
<para>
Этот метод определяет был ли PHP сконфигурирован с <link
xlink:href="&url.exsltlib;">библиотекой EXSLT</link>.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Проверка поддержки EXSLT</title>
<programlisting role="php">
<![CDATA[
<?php
$proc = new XSLTProcessor;
if (!$proc->hasExsltSupport()) {
die('EXSLT support not available');
}
// выполнение некоторых действий EXSLT ..
?>
]]>
</programlisting>
</example>
</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
-->

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.importstylesheet" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::importStylesheet</refname>
<refpurpose>Импортирует таблицу стилей</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>void</type><methodname>importStylesheet</methodname>
<methodparam><type>object</type><parameter>stylesheet</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Этот метод импортирует таблицу стилей в
<classname>XSLTProcessor</classname> для трансформации.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>stylesheet</parameter></term>
<listitem>
<para>
Импортируемая таблица стилей в виде объекта <classname>DOMDocument</classname> или
<classname>SimpleXMLElement</classname>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.2.8</entry>
<entry>
Принимает <classname>SimpleXMLElement</classname> вновь, что было невозможно
в версии PHP 5.2.6 и более поздних.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</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
-->

View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.registerphpfunctions" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::registerPHPFunctions</refname>
<refpurpose>Включает возможность использовать PHP функции в качестве функций XSLT</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>void</type>
<methodname>registerPHPFunctions</methodname>
<methodparam choice="opt"><type>mixed</type><parameter>restrict</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Этот метод позволяет использовать PHP функции как функции XSLT
в XSL таблицах стилей.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>restrict</parameter></term>
<listitem>
<para>
Используйте этот параметр, если хотите вызывать из XSLT только некоторые функции из.
</para>
<para>
Этот параметр может принимать либо строковое значение - название функции, либо массив - список названий.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Простой вызов функции PHP из таблицы стилей</title>
<programlisting role="php"><![CDATA[<?php
$xml = <<<EOB
<allusers>
<user>
<uid>bob</uid>
</user>
<user>
<uid>joe</uid>
</user>
</allusers>
EOB;
$xsl = <<<EOB
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl">
<xsl:output method="html" encoding="utf-8" indent="yes"/>
<xsl:template match="allusers">
<html><body>
<h2>Users</h2>
<table>
<xsl:for-each select="user">
<tr><td>
<xsl:value-of
select="php:function('ucfirst',string(uid))"/>
</td></tr>
</xsl:for-each>
</table>
</body></html>
</xsl:template>
</xsl:stylesheet>
EOB;
$xmldoc = DOMDocument::loadXML($xml);
$xsldoc = DOMDocument::loadXML($xsl);
$proc = new XSLTProcessor();
$proc->registerPHPFunctions();
$proc->importStyleSheet($xsldoc);
echo $proc->transformToXML($xmldoc);
?>]]></programlisting>
</example>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.1.0</entry>
<entry>
Был добавлен параметр <parameter>restrict</parameter>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</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
-->

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.removeparameter" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::removeParameter</refname>
<refpurpose>Удаляет параметр</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>bool</type>
<methodname>removeParameter</methodname>
<methodparam><type>string</type><parameter>namespaceURI</parameter></methodparam>
<methodparam><type>string</type><parameter>localName</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Удаляет параметр, если он установлен. Это позволяет процессору
использовать значение в таблице стилей, установленное по умолчанию.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>namespaceURI</parameter></term>
<listitem>
<para>
Пространство имён URI параметра XSLT.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>localName</parameter></term>
<listitem>
<para>
Локальное название XSLT параметра.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>XSLTProcessor::setParameter</function></member>
<member><function>XSLTProcessor::getParameter</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
-->

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.setparameter" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::setParameter</refname>
<refpurpose>Устанавливает значение параметра</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>
Устанавливает значение для одного или нескольких параметров, чтобы использовать в дальнейшем
в преобразованиях <classname>XSLTProcessor</classname>.
Если параметра нет в таблице стилей, то он будет проигнорирован.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>namespace</parameter></term>
<listitem>
<para>
Пространство имён URI параметра XSLT.
</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>name =&gt; value</literal>. Этот синтаксис доступен
с 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>Изменение владельца перед преобразованием</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) {
// 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
-->

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.setprofiling" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::setProfiling</refname>
<refpurpose>Устанавливает файл для профилирования</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>bool</type><methodname>setProfiling</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Устанавливает файл для записи профилирующей информации во время обработки таблиц стилей.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
Путь к файлу, в который записывается профилирующая информация.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример вывода профилирующей информации</title>
<programlisting role="php">
<![CDATA[
<?php
// Загрузка исходного XML
$xml = new DOMDocument;
$xml->load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Настройка преобразования
$proc = new XSLTProcessor;
$proc->setProfiling('profiling.txt');
$proc->importStyleSheet($xsl); // добавление стилей xsl
echo trim($proc->transformToDoc($xml)->firstChild->wholeText);
?>
]]>
</programlisting>
<para>
Вышеприведенный код записывает следующую информацию в файл профилирования:
</para>
<screen>
<![CDATA[
number match name mode Calls Tot 100us Avg
0 cd 2 3 1
1 collection 1 1 1
Total 3 4
]]>
</screen>
</example>
</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
-->

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.transformtodoc" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::transformToDoc</refname>
<refpurpose>Преобразовует в DOMDocument</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>DOMDocument</type>
<methodname>transformToDoc</methodname>
<methodparam><type>DOMNode</type><parameter>doc</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Преобразовует исходный узел в <classname>DOMDocument</classname> применяя
таблицу стилей, заданую с помощью метода
<function>XSLTProcessor::importStylesheet</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>doc</parameter></term>
<listitem>
<para>
Узел, который нужено преобразовать.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает <classname>DOMDocument</classname> или &false; при ошибке.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Преобразование в DOMDocument</title>
<programlisting role="php">
<![CDATA[
<?php
// Загрузка исходного XML
$xml = new DOMDocument;
$xml->load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Настройка преобразования
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo trim($proc->transformToDoc($xml)->firstChild->wholeText);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection!
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>XSLTProcessor::transformToUri</function></member>
<member><function>XSLTProcessor::transformToXml</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
-->

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: af6e1aeca5aad7e6c6e35597f74c762e72540952 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.transformtouri" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::transformToUri</refname>
<refpurpose>Преобразует в URI</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>int</type>
<methodname>transformToURI</methodname>
<methodparam><type>DOMDocument</type><parameter>doc</parameter></methodparam>
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Преобразует исходный узел в URI, применяя таблицу стилей, которая установленна с помощью метода
<function>XSLTProcessor::importStylesheet</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>doc</parameter></term>
<listitem>
<para>
Документ для преобразоваия.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>uri</parameter></term>
<listitem>
<para>
Целевой URI для преобразования.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает количество записаных байтов, либо &false; при ошибке.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Преобразование в HTML файл</title>
<programlisting role="php">
<![CDATA[
<?php
// Загрузка источника XML
$xml = new DOMDocument;
$xml->load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Настройка преобразования
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
$proc->transformToURI($xml, 'file:///tmp/out.html');
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>XSLTProcessor::transformToDoc</function></member>
<member><function>XSLTProcessor::transformToXml</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
-->

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision: $ -->
<refentry xml:id="xsltprocessor.transformtoxml" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>XSLTProcessor::transformToXML</refname>
<refpurpose>Преобразует в XML</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<classsynopsis>
<ooclass><classname>XSLTProcessor</classname></ooclass>
<methodsynopsis>
<type>string</type>
<methodname>transformToXML</methodname>
<methodparam><type>DOMDocument</type><parameter>doc</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
Преобразует исходный узел в строку, применяя таблицы стилей, которые установлены с помощью метода
<function>xsltprocessor::importStylesheet</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>doc</parameter></term>
<listitem>
<para>
Преобразуемый документ.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Результат преобразования, или &false; при ошибке.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Трансформация в строку</title>
<programlisting role="php">
<![CDATA[
<?php
// Загрузка источника XML
$xml = new DOMDocument;
$xml->load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Настройка преобразования
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection!
<h1>Fight for your mind</h1><h2>by Ben Harper - 1995</h2><hr>
<h1>Electric Ladyland</h1><h2>by Jimi Hendrix - 1997</h2><hr>
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>XSLTProcessor::transformToDoc</function></member>
<member><function>XSLTProcessor::transformToUri</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
-->