svn: /phpdoc/ru/trunk/reference/ xml/functions/utf8-encode.xml xml/functions/xml-parser-create-ns.xml xsl/examples.xml
| From: | Alexander Moskaliov | Date: | Thu, 25 Dec 2014 21:36:40 +0000 |
| Subject: | svn: /phpdoc/ru/trunk/reference/ xml/functions/utf8-encode.xml xml/functions/xml-parser-create-ns.xml xsl/examples.xml | ||
| Groups: | php.doc.ru | ||
| Request: | Send a blank email to doc-ru+get-4718@lists.php.net to get a copy of this message | ||
irker Thu, 25 Dec 2014 21:36:40 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=335366
Log:
Updated translation
Changed paths:
U phpdoc/ru/trunk/reference/xml/functions/utf8-encode.xml
U phpdoc/ru/trunk/reference/xml/functions/xml-parser-create-ns.xml
U phpdoc/ru/trunk/reference/xsl/examples.xml
Modified: phpdoc/ru/trunk/reference/xml/functions/utf8-encode.xml
===================================================================
--- phpdoc/ru/trunk/reference/xml/functions/utf8-encode.xml 2014-12-25 21:28:17 UTC (rev 335365)
+++ phpdoc/ru/trunk/reference/xml/functions/utf8-encode.xml 2014-12-25 21:36:40 UTC (rev 335366)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 297028 Maintainer: tmn Status: ready -->
+<!-- EN-Revision: 333158 Maintainer: tmn Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.utf8-encode">
@@ -88,6 +88,15 @@
</para>
</refsect1>
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>utf8_decode</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
</refentry>
<!-- Keep this comment at the end of the file
Modified: phpdoc/ru/trunk/reference/xml/functions/xml-parser-create-ns.xml
===================================================================
--- phpdoc/ru/trunk/reference/xml/functions/xml-parser-create-ns.xml 2014-12-25 21:28:17 UTC (rev
335365)
+++ phpdoc/ru/trunk/reference/xml/functions/xml-parser-create-ns.xml 2014-12-25 21:36:40 UTC (rev
335366)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 327378 Maintainer: tmn Status: ready -->
+<!-- EN-Revision: 333317 Maintainer: tmn Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id='function.xml-parser-create-ns'>
@@ -13,7 +13,7 @@
<methodsynopsis>
<type>resource</type><methodname>xml_parser_create_ns</methodname>
<methodparam
choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
- <methodparam
choice="opt"><type>string</type><parameter>separator</parameter><initializer>':'</initializer></methodparam>
+ <methodparam
choice="opt"><type>string</type><parameter>separator</parameter><initializer>":"</initializer></methodparam>
</methodsynopsis>
<para>
<function>xml_parser_create_ns</function> создает новый XML
анализатор с
Modified: phpdoc/ru/trunk/reference/xsl/examples.xml
===================================================================
--- phpdoc/ru/trunk/reference/xsl/examples.xml 2014-12-25 21:28:17 UTC (rev 335365)
+++ phpdoc/ru/trunk/reference/xsl/examples.xml 2014-12-25 21:36:40 UTC (rev 335366)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 310851 Maintainer: aur Status: ready -->
+<!-- EN-Revision: 335141 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
@@ -54,6 +54,94 @@
</example>
</para>
</section>
+
+
+ <section xml:id="xsl.examples-errors">
+ <title>Обработка ошибок с помощью функций обработки
ошибок libxml</title>
+ <para>
+ libxml предоставляет ряд функций для обработки ошибок,
которые
+ могут использоваться для отлова и работы с ошибками
при обработке XSLT.
+ </para>
+ <para>
+ <example>
+ <title>fruits.xml</title>
+ <para>Правильный XML.</para>
+ <programlisting role="xml">
+<![CDATA[
+<fruits>
+ <fruit>Apple</fruit>
+ <fruit>Banana</fruit>
+ <fruit>Cherry</fruit>
+</fruits>
+]]>
+ </programlisting>
+ </example>
+ <example>
+ <title>fruits.xsl</title>
+ <para>Содержит неверное "select"
выражение.</para>
+ <programlisting role="xml">
+<![CDATA[
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="html" encoding="utf-8" indent="no"/>
+ <xsl:template match="fruits">
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+ <xsl:template match="fruit">
+ <li><xsl:value-of select="THIS IS A DELIBERATE ERROR!"/></li>
+ </xsl:template>
+</xsl:stylesheet>
+]]>
+ </programlisting>
+ </example>
+ <example xml:id="xsl.examples-errors.capture">
+ <title>Сбор и вывод ошибок</title>
+ <para>
+ Пример ниже отлавливает и отображает ошибки libxml,
появляющиеся
+ при выхове метода
<methodname>XSLTProcessor::importStyleSheet</methodname>
+ со стилем содержащим ошибки.
+ </para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$xmldoc = new DOMDocument();
+$xsldoc = new DOMDocument();
+$xsl = new XSLTProcessor();
+
+$xmldoc->loadXML('fruits.xml');
+$xsldoc->loadXML('fruits.xsl');
+
+libxml_use_internal_errors(true);
+$result = $xsl->importStyleSheet($xsldoc);
+if (!$result) {
+ foreach (libxml_get_errors() as $error) {
+ echo "Libxml error: {$error->message}\n";
+ }
+}
+libxml_use_internal_errors(false);
+
+if ($result) {
+ echo $xsl->transformToXML($xmldoc);
+}
+
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+Libxml error: Invalid expression
+
+Libxml error: compilation error: file fruits.xsl line 9 element value-of
+Libxml error: xsl:value-of : could not compile select expression 'THIS IS A DELIBERATE
ERROR!'
+]]>
+ </screen>
+ </example>
+ </para>
+ </section>
+
</chapter>
<!-- Keep this comment at the end of the file
Local variables: