WS, prepare for new doc style

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237383 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-06-11 00:05:00 +00:00
parent 983e2a43ef
commit e4e6e9c60a
19 changed files with 841 additions and 856 deletions

View file

@ -1,32 +1,30 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.xslt-backend-info">
<refnamediv>
<refname>xslt_backend_info</refname>
<refpurpose>
Returns the information on the compilation settings of the backend
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_backend_info</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_backend_info</function> returns a string with
information about the compilation setting of the backend
or an error string when no information available.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_backend_name</function>&listendand;
<function>xslt_backend_version</function>.
</para>
</refsect1>
</refentry>
<!-- $Revision: 1.4 $ -->
<refentry id="function.xslt-backend-info">
<refnamediv>
<refname>xslt_backend_info</refname>
<refpurpose>Returns the information on the compilation settings of the backend</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_backend_info</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_backend_info</function> returns a string with
information about the compilation setting of the backend
or an error string when no information available.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_backend_name</function>&listendand;
<function>xslt_backend_version</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,28 +1,26 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.xslt-backend-name">
<refnamediv>
<refname>xslt_backend_name</refname>
<refpurpose>
Returns the name of the backend
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_backend_name</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_backend_name</function> will always return
<productname>Sablotron</productname>.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_backend_name</function> example</title>
<programlisting role="php">
<!-- $Revision: 1.4 $ -->
<refentry id="function.xslt-backend-name">
<refnamediv>
<refname>xslt_backend_name</refname>
<refpurpose>Returns the name of the backend</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_backend_name</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_backend_name</function> will always return
<productname>Sablotron</productname>.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_backend_name</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -30,17 +28,17 @@ echo xslt_backend_name(); // Sablotron
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_backend_info</function>&listendand;
<function>xslt_backend_version</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_backend_info</function>&listendand;
<function>xslt_backend_version</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,29 +1,27 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.4 $ -->
<refentry id="function.xslt-backend-version">
<refnamediv>
<refname>xslt_backend_version</refname>
<refpurpose>
Returns the version number of Sablotron
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_backend_version</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_backend_version</function> returns the version
number of <productname>Sablotron</productname> if available,
&false; otherwise.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_backend_version</function> example</title>
<programlisting role="php">
<!-- $Revision: 1.5 $ -->
<refentry id="function.xslt-backend-version">
<refnamediv>
<refname>xslt_backend_version</refname>
<refpurpose>Returns the version number of Sablotron</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_backend_version</methodname>
<void/>
</methodsynopsis>
<para>
<function>xslt_backend_version</function> returns the version
number of <productname>Sablotron</productname> if available,
&false; otherwise.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_backend_version</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -31,17 +29,17 @@ echo xslt_backend_version(); // 0.98 for example
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_backend_name</function>&listendand;
<function>xslt_backend_info</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_backend_name</function>&listendand;
<function>xslt_backend_info</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,33 +1,33 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-create">
<refnamediv>
<refname>xslt_create</refname>
<refpurpose>Create a new XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>xslt_create</methodname>
<void/>
</methodsynopsis>
<para>
Create and return a new XSLT processor resource for manipulation by the
other XSLT functions.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_create</function> example</title>
<programlisting role="php">
<refentry id="function.xslt-create">
<refnamediv>
<refname>xslt_create</refname>
<refpurpose>Create a new XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>xslt_create</methodname>
<void/>
</methodsynopsis>
<para>
Create and return a new XSLT processor resource for manipulation by the
other XSLT functions.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_create</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
function xml2html($xmldata, $xsl)
{
function xml2html($xmldata, $xsl)
{
/* $xmldata -> your XML */
/* $xsl -> XSLT file */
/* $xsl -> XSLT file */
$path = 'include';
$arguments = array('/_xml' => $xmldata);
@ -41,19 +41,19 @@ function xml2html($xmldata, $xsl)
}
xslt_free($xsltproc);
return $html;
}
}
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_free</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_free</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,29 +1,29 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-errno">
<refnamediv>
<refname>xslt_errno</refname>
<refpurpose>Returns an error number</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>xslt_errno</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Returns an error code describing the last error that occurred on the
passed XSLT processor.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_error</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-errno">
<refnamediv>
<refname>xslt_errno</refname>
<refpurpose>Returns an error number</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>xslt_errno</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Returns an error code describing the last error that occurred on the
passed XSLT processor.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_error</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,37 +1,37 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-error">
<refnamediv>
<refname>xslt_error</refname>
<refpurpose>Returns an error string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_error</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Returns a string describing the last error that occurred on the
passed XSLT processor.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title>
Handling errors using the <function>xslt_error</function> and
<function>xslt_errno</function> functions.
</title>
<programlisting role="php">
<refentry id="function.xslt-error">
<refnamediv>
<refname>xslt_error</refname>
<refpurpose>Returns an error string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>xslt_error</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Returns a string describing the last error that occurred on the
passed XSLT processor.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title>
Handling errors using the <function>xslt_error</function> and
<function>xslt_errno</function> functions.
</title>
<programlisting role="php">
<![CDATA[
<?php
$xh = xslt_create();
$result = xslt_process($xh, 'dog.xml', 'pets.xsl');
if (!$result) {
die(sprintf("Cannot process XSLT document [%d]: %s",
die(sprintf("Cannot process XSLT document [%d]: %s",
xslt_errno($xh), xslt_error($xh)));
}
@ -40,16 +40,16 @@ echo $result;
xslt_free($xh);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_errno</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_errno</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-free">
<refnamediv>
<refname>xslt_free</refname>
<refpurpose>Free XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_free</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Free the XSLT processor identified by the given handle.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_create</function>
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-free">
<refnamediv>
<refname>xslt_free</refname>
<refpurpose>Free XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_free</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
</methodsynopsis>
<para>
Free the XSLT processor identified by the given handle.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_create</function>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,30 +1,28 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.xslt-getopt">
<refnamediv>
<refname>xslt_getopt</refname>
<refpurpose>
Get options on a given xsl processor
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>xslt_getopt</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_getopt</function> returns the options on the given
<parameter>processor</parameter>.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_setopt</function>.
</para>
</refsect1>
</refentry>
<!-- $Revision: 1.4 $ -->
<refentry id="function.xslt-getopt">
<refnamediv>
<refname>xslt_getopt</refname>
<refpurpose>Get options on a given xsl processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>xslt_getopt</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_getopt</function> returns the options on the given
<parameter>processor</parameter>.
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_setopt</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,59 +1,59 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.18 $ -->
<!-- $Revision: 1.19 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-process">
<refnamediv>
<refname>xslt_process</refname>
<refpurpose>Perform an XSLT transformation</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>xslt_process</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>xmlcontainer</parameter></methodparam>
<methodparam><type>string</type><parameter>xslcontainer</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>resultcontainer</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>arguments</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>parameters</parameter></methodparam>
</methodsynopsis>
<para>
The <function>xslt_process</function> function is the crux of the new
XSLT extension. It allows you to perform an XSLT transformation using
almost any type of input source - the containers. This is accomplished
through the use of argument buffers -- a concept taken from the Sablotron
XSLT processor (currently the only XSLT processor this extension supports).
The input containers default to a filename 'containing' the document to be
processed. The result container defaults to a filename for the transformed
document. If the result container is not specified - i.e.
&null; - than the result is returned.
</para>
<para>
<warning>
<simpara>
As of PHP 4.0.6, this function no longer takes XML strings in
<parameter>xmlcontainer</parameter> or
<parameter>xslcontainer</parameter>. Passing a string containing XML
to either of these parameters will result in a segmentation fault in
Sablotron versions up to and including version 0.95.
</simpara>
</warning>
</para>
<para>
Containers can also be set via the <parameter>arguments</parameter>
array (see below).
</para>
<para>
The simplest type of transformation with the
<function>xslt_process</function> function is the transformation of an
XML file with an XSLT file, placing the result in a third file containing
the new XML (or HTML) document. Doing this with sablotron is really
quite easy...
</para>
<example>
<title>Using the <function>xslt_process</function> to transform an XML
file and a XSL file to a new XML file</title>
<programlisting role="php">
<refentry id="function.xslt-process">
<refnamediv>
<refname>xslt_process</refname>
<refpurpose>Perform an XSLT transformation</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>xslt_process</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>xmlcontainer</parameter></methodparam>
<methodparam><type>string</type><parameter>xslcontainer</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>resultcontainer</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>arguments</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>parameters</parameter></methodparam>
</methodsynopsis>
<para>
The <function>xslt_process</function> function is the crux of the new
XSLT extension. It allows you to perform an XSLT transformation using
almost any type of input source - the containers. This is accomplished
through the use of argument buffers -- a concept taken from the Sablotron
XSLT processor (currently the only XSLT processor this extension supports).
The input containers default to a filename 'containing' the document to be
processed. The result container defaults to a filename for the transformed
document. If the result container is not specified - i.e.
&null; - than the result is returned.
</para>
<para>
<warning>
<simpara>
As of PHP 4.0.6, this function no longer takes XML strings in
<parameter>xmlcontainer</parameter> or
<parameter>xslcontainer</parameter>. Passing a string containing XML
to either of these parameters will result in a segmentation fault in
Sablotron versions up to and including version 0.95.
</simpara>
</warning>
</para>
<para>
Containers can also be set via the <parameter>arguments</parameter>
array (see below).
</para>
<para>
The simplest type of transformation with the
<function>xslt_process</function> function is the transformation of an
XML file with an XSLT file, placing the result in a third file containing
the new XML (or HTML) document. Doing this with sablotron is really
quite easy...
</para>
<example>
<title>Using the <function>xslt_process</function> to transform an XML
file and a XSL file to a new XML file</title>
<programlisting role="php">
<![CDATA[
<?php
@ -77,20 +77,20 @@ xslt_free($xh);
?>
]]>
</programlisting>
</example>
<para>
While this functionality is great, many times, especially in a web environment, you want to
be able to print out your results directly. Therefore, if you omit the third argument to
the <function>xslt_process</function> function (or provide a NULL value for the argument), it
will automatically return the value of the XSLT transformation, instead of writing it to a
file...
</para>
<para>
<example>
<title>Using the <function>xslt_process</function> to transform an XML file and a XSL file
to a variable containing the resulting XML data</title>
<programlisting role="php">
</programlisting>
</example>
<para>
While this functionality is great, many times, especially in a web environment, you want to
be able to print out your results directly. Therefore, if you omit the third argument to
the <function>xslt_process</function> function (or provide a NULL value for the argument), it
will automatically return the value of the XSLT transformation, instead of writing it to a
file...
</para>
<para>
<example>
<title>Using the <function>xslt_process</function> to transform an XML file and a XSL file
to a variable containing the resulting XML data</title>
<programlisting role="php">
<![CDATA[
<?php
@ -107,7 +107,7 @@ if ($result) {
echo "</pre>\n";
} else {
echo "Sorry, sample.xml could not be transformed by sample.xsl into";
echo " the \$result variable the reason is that " . xslt_error($xh);
echo " the \$result variable the reason is that " . xslt_error($xh);
echo " and the error code is " . xslt_errno($xh);
}
@ -115,26 +115,26 @@ xslt_free($xh);
?>
]]>
</programlisting>
</example>
</para>
<para>
The above two cases are the two simplest cases there are when it comes to XSLT transformation
and I'd dare say that they are the most common cases, however, sometimes you get your XML and
XSLT code from external sources, such as a database or a socket. In these cases you'll have
the XML and/or XSLT data in a variable -- and in production applications the overhead of dumping
these to file may be too much. This is where XSLT's &quot;argument&quot; syntax, comes to the
rescue. Instead of files as the XML and XSLT arguments to the <function>xslt_process</function>
function, you can specify &quot;argument place holders&quot; which are then substituted by values
given in the arguments array (5th parameter to the <function>xslt_process</function> function).
The following is an example of processing XML and XSLT into a result variable without the use
of files at all.
</para>
<para>
<example>
<title>Using the <function>xslt_process</function> to transform a variable containing XML data
and a variable containing XSL data into a variable containing the resulting XML data</title>
<programlisting role="php">
</programlisting>
</example>
</para>
<para>
The above two cases are the two simplest cases there are when it comes to XSLT transformation
and I'd dare say that they are the most common cases, however, sometimes you get your XML and
XSLT code from external sources, such as a database or a socket. In these cases you'll have
the XML and/or XSLT data in a variable -- and in production applications the overhead of dumping
these to file may be too much. This is where XSLT's &quot;argument&quot; syntax, comes to the
rescue. Instead of files as the XML and XSLT arguments to the <function>xslt_process</function>
function, you can specify &quot;argument place holders&quot; which are then substituted by values
given in the arguments array (5th parameter to the <function>xslt_process</function> function).
The following is an example of processing XML and XSLT into a result variable without the use
of files at all.
</para>
<para>
<example>
<title>Using the <function>xslt_process</function> to transform a variable containing XML data
and a variable containing XSL data into a variable containing the resulting XML data</title>
<programlisting role="php">
<![CDATA[
<?php
// $xml and $xsl contain the XML and XSL data
@ -148,7 +148,7 @@ $arguments = array(
$xh = xslt_create();
// Process the document
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
if ($result) {
echo "SUCCESS, sample.xml was transformed by sample.xsl into the \$result";
echo " variable, the \$result variable has the following contents\n<br />\n";
@ -163,22 +163,22 @@ if ($result) {
xslt_free($xh);
?>
]]>
</programlisting>
</example>
</para>
<para>
Finally, the last argument to the <function>xslt_process</function>
function represents an array for any top-level parameters that you want to
pass to the XSLT document. These parameters can then be accessed within
your XSL files using the &lt;xsl:param name=&quot;parameter_name&quot;&gt;
instruction. The parameters must be UTF-8 encoded and their values will be
interpreted as strings by the <productname>Sablotron</productname> processor.
In other words - you cannot pass node-sets as parameters to the XSLT document.
</para>
<para>
<example>
<title>Passing PHP variables to XSL files</title>
<programlisting role="php">
</programlisting>
</example>
</para>
<para>
Finally, the last argument to the <function>xslt_process</function>
function represents an array for any top-level parameters that you want to
pass to the XSLT document. These parameters can then be accessed within
your XSL files using the &lt;xsl:param name=&quot;parameter_name&quot;&gt;
instruction. The parameters must be UTF-8 encoded and their values will be
interpreted as strings by the <productname>Sablotron</productname> processor.
In other words - you cannot pass node-sets as parameters to the XSLT document.
</para>
<para>
<example>
<title>Passing PHP variables to XSL files</title>
<programlisting role="php">
<![CDATA[
<?php
@ -191,7 +191,7 @@ $xml = '<?xml version="1.0"?>
// XSL string
$xsl = '
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1" indent="no"
<xsl:output method="html" encoding="ISO-8859-1" indent="no"
omit-xml-declaration="yes" media-type="text/html"/>
<xsl:param name="myvar"/>
<xsl:param name="mynode"/>
@ -219,19 +219,19 @@ echo xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments, $parameters);
?>
]]>
</programlisting>
&example.outputs;
<screen>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
My PHP variable : test<br>
My node set : &lt;foo&gt;bar&lt;/foo&gt;
]]>
</screen>
</example>
</para>
&note.xslt.windows;
</refsect1>
</refentry>
</screen>
</example>
</para>
&note.xslt.windows;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,31 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-set-base">
<refnamediv>
<refname>xslt_set_base</refname>
<refpurpose>Set the base URI for all XSLT transformations</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_base</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
</methodsynopsis>
<para>
Sets the base URI for all XSLT transformations, the base URI is used
with Xpath instructions to resolve document() and other commands which
access external resources. It is also used to resolve URIs for the &lt;xsl:include&gt;
and &lt;xsl:import&gt; elements.
</para>
<para>
As of 4.3, the default base URI is the directory of the executing script. In effect, it is the
directory name value of the <constant>__FILE__</constant> constant. Prior to 4.3, the default base URI was less predictable.
</para>
&note.xslt.windows;
</refsect1>
</refentry>
<refentry id="function.xslt-set-base">
<refnamediv>
<refname>xslt_set_base</refname>
<refpurpose>Set the base URI for all XSLT transformations</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_base</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
</methodsynopsis>
<para>
Sets the base URI for all XSLT transformations, the base URI is used
with Xpath instructions to resolve document() and other commands which
access external resources. It is also used to resolve URIs for the &lt;xsl:include&gt;
and &lt;xsl:import&gt; elements.
</para>
<para>
As of 4.3, the default base URI is the directory of the executing script.
In effect, it is the directory name value of the <constant>__FILE__</constant>
constant. Prior to 4.3, the default base URI was less predictable.
</para>
&note.xslt.windows;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-set-encoding">
<refnamediv>
<refname>xslt_set_encoding</refname>
<refpurpose>Set the encoding for the parsing of XML documents</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_encoding</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>encoding</parameter></methodparam>
</methodsynopsis>
<para>
Set the output encoding for the XSLT transformations. When using the
<productname>Sablotron</productname> backend, this option is only
available when you compile <productname>Sablotron</productname> with
encoding support.
</para>
</refsect1>
</refentry>
<refentry id="function.xslt-set-encoding">
<refnamediv>
<refname>xslt_set_encoding</refname>
<refpurpose>Set the encoding for the parsing of XML documents</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_encoding</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>string</type><parameter>encoding</parameter></methodparam>
</methodsynopsis>
<para>
Set the output encoding for the XSLT transformations. When using the
<productname>Sablotron</productname> backend, this option is only
available when you compile <productname>Sablotron</productname> with
encoding support.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,47 +1,47 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.1 -->
<refentry id="function.xslt-set-error-handler">
<refnamediv>
<refname>xslt_set_error_handler</refname>
<refpurpose>Set an error handler for a XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_error_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>mixed</type><parameter>handler</parameter></methodparam>
</methodsynopsis>
<para>
Set an error handler function for the XSLT processor given by
<parameter>xh</parameter>, this function will be called whenever an
error occurs in the XSLT transformation (this function is also called
for notices).
</para>
<para>
The user function needs to accept four parameters: the XSLT processor,
the error level, the error code and an array of messages. The function
can be shown as:
<methodsynopsis>
<methodname><replaceable>error_handler</replaceable></methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>int</type><parameter>error_level</parameter></methodparam>
<methodparam><type>int</type><parameter>error_code</parameter></methodparam>
<methodparam><type>array</type><parameter>messages</parameter></methodparam>
</methodsynopsis>
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_set_error_handler</function> Example</title>
<programlisting role="php">
<refentry id="function.xslt-set-error-handler">
<refnamediv>
<refname>xslt_set_error_handler</refname>
<refpurpose>Set an error handler for a XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_error_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>mixed</type><parameter>handler</parameter></methodparam>
</methodsynopsis>
<para>
Set an error handler function for the XSLT processor given by
<parameter>xh</parameter>, this function will be called whenever an
error occurs in the XSLT transformation (this function is also called
for notices).
</para>
<para>
The user function needs to accept four parameters: the XSLT processor,
the error level, the error code and an array of messages. The function
can be shown as:
<methodsynopsis>
<methodname><replaceable>error_handler</replaceable></methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>int</type><parameter>error_level</parameter></methodparam>
<methodparam><type>int</type><parameter>error_code</parameter></methodparam>
<methodparam><type>array</type><parameter>messages</parameter></methodparam>
</methodsynopsis>
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_set_error_handler</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
// Our XSLT error handler
function xslt_error_handler($handler, $errno, $level, $info)
function xslt_error_handler($handler, $errno, $level, $info)
{
// for now, let's just see the arguments
var_dump(func_get_args());
@ -70,9 +70,9 @@ echo xslt_process($xh, 'arg:/_xml', 'arg:/_xsl',
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
array(4) {
[0]=>
@ -98,17 +98,17 @@ array(4) {
}
}
]]>
</screen>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_set_object</function> if you want to use an
object method as handler.
</para>
</refsect1>
</refentry>
</screen>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_set_object</function> if you want to use an
object method as handler.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,58 +1,58 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-set-log">
<refnamediv>
<refname>xslt_set_log</refname>
<refpurpose>Set the log file to write log messages to</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_log</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>log</parameter></methodparam>
</methodsynopsis>
<para>
<variablelist>
<varlistentry>
<term><parameter>xh</parameter></term>
<listitem>
<simpara>
A reference to the XSLT parser.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>log</parameter></term>
<listitem>
<simpara>
This parameter is either a boolean value which toggles logging on and
off, or a string containing the logfile in which log errors too.
</simpara>
</listitem>
</varlistentry>
</variablelist></para>
<para>
This function allows you to set the file in which you want XSLT log
messages to, XSLT log messages are different than error messages, in
that log messages are not actually error messages but rather messages
related to the state of the XSLT processor. They are useful for
debugging XSLT, when something goes wrong.
</para>
<para>
By default logging is disabled, in order to enable logging you must
first call <function>xslt_set_log</function> with a boolean parameter
which enables logging, then if you want to set the log file to debug to,
you must then pass it a string containing the filename.
</para>
&note.xslt.windows;
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title>Using the XSLT Logging features</title>
<programlisting role="php">
<refentry id="function.xslt-set-log">
<refnamediv>
<refname>xslt_set_log</refname>
<refpurpose>Set the log file to write log messages to</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_log</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>log</parameter></methodparam>
</methodsynopsis>
<para>
<variablelist>
<varlistentry>
<term><parameter>xh</parameter></term>
<listitem>
<simpara>
A reference to the XSLT parser.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>log</parameter></term>
<listitem>
<simpara>
This parameter is either a boolean value which toggles logging on and
off, or a string containing the logfile in which log errors too.
</simpara>
</listitem>
</varlistentry>
</variablelist></para>
<para>
This function allows you to set the file in which you want XSLT log
messages to, XSLT log messages are different than error messages, in
that log messages are not actually error messages but rather messages
related to the state of the XSLT processor. They are useful for
debugging XSLT, when something goes wrong.
</para>
<para>
By default logging is disabled, in order to enable logging you must
first call <function>xslt_set_log</function> with a boolean parameter
which enables logging, then if you want to set the log file to debug to,
you must then pass it a string containing the filename.
</para>
&note.xslt.windows;
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title>Using the XSLT Logging features</title>
<programlisting role="php">
<![CDATA[
<?php
@ -66,10 +66,10 @@ echo $result;
xslt_free($xh);
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,44 +1,42 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.6 $ -->
<refentry id="function.xslt-set-object">
<refnamediv>
<refname>xslt_set_object</refname>
<refpurpose>
Sets the object in which to resolve callback functions
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_set_object</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>object</type><parameter role="reference">obj</parameter></methodparam>
</methodsynopsis>
<para>
This function allows to use the <parameter>processor</parameter> inside
an <parameter>object</parameter> and to resolve all callback functions
in it.
</para>
<para>
The callback functions can be declared with
<function>xml_set_sax_handlers</function>,
<function>xslt_set_scheme_handlers</function> or
<function>xslt_set_error_handler</function> and are assumed to be methods
of <parameter>object</parameter>.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title>Using your own error handler as a method</title>
<programlisting role="php">
<!-- $Revision: 1.7 $ -->
<refentry id="function.xslt-set-object">
<refnamediv>
<refname>xslt_set_object</refname>
<refpurpose>Sets the object in which to resolve callback functions</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>xslt_set_object</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>object</type><parameter role="reference">obj</parameter></methodparam>
</methodsynopsis>
<para>
This function allows to use the <parameter>processor</parameter> inside
an <parameter>object</parameter> and to resolve all callback functions
in it.
</para>
<para>
The callback functions can be declared with
<function>xml_set_sax_handlers</function>,
<function>xslt_set_scheme_handlers</function> or
<function>xslt_set_error_handler</function> and are assumed to be methods
of <parameter>object</parameter>.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title>Using your own error handler as a method</title>
<programlisting role="php">
<![CDATA[
<?php
class my_xslt_processor {
var $_xh; // our XSLT processor
function my_xslt_processor()
{
$this->_xh = xslt_create();
@ -59,10 +57,10 @@ class my_xslt_processor {
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,37 +1,37 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-set-sax-handler">
<refnamediv>
<refname>xslt_set_sax_handler</refname>
<refpurpose>Set SAX handlers for a XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_sax_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
Set SAX handlers on the resource handle given by
<parameter>xh</parameter>. SAX handlers should be a two dimensional array
with the format (all top level elements are optional):
<informalexample>
<programlisting role="php">
<refentry id="function.xslt-set-sax-handler">
<refnamediv>
<refname>xslt_set_sax_handler</refname>
<refpurpose>Set SAX handlers for a XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_sax_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
Set SAX handlers on the resource handle given by
<parameter>xh</parameter>. SAX handlers should be a two dimensional array
with the format (all top level elements are optional):
<informalexample>
<programlisting role="php">
<![CDATA[
array(
[document] =>
[document] =>
array(
start document handler,
end document handler
),
[element] =>
[element] =>
array(
start element handler,
end element handler
),
[namespace] =>
[namespace] =>
array(
start namespace handler,
end namespace handler
@ -41,11 +41,11 @@ array(
[character] => character data handler
)
]]>
</programlisting>
</informalexample>
</para>
</refsect1>
</refentry>
</programlisting>
</informalexample>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,29 +1,27 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.29 -->
<refentry id='function.xslt-set-sax-handlers'>
<refnamediv>
<refname>xslt_set_sax_handlers</refname>
<refpurpose>
Set the SAX handlers to be called when the XML document gets processed
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_sax_handlers</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_set_sax_handlers</function> registers the SAX
<parameter>handlers</parameter> for the document, given a XSLT
<parameter>processor</parameter> resource.
</para>
<para>
<parameter>handlers</parameter> should be an array in the following format:
<informalexample>
<programlisting role="php">
<refentry id='function.xslt-set-sax-handlers'>
<refnamediv>
<refname>xslt_set_sax_handlers</refname>
<refpurpose>Set the SAX handlers to be called when the XML document gets processed</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_sax_handlers</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_set_sax_handlers</function> registers the SAX
<parameter>handlers</parameter> for the document, given a XSLT
<parameter>processor</parameter> resource.
</para>
<para>
<parameter>handlers</parameter> should be an array in the following format:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
@ -50,121 +48,121 @@ $handlers = array(
);
?>
]]>
</programlisting>
</informalexample>
Where the functions follow the syntax described for the scheme handler
functions.
</para>
<note>
<para>
The given array does not need to contain all of the different sax
handler elements (although it can), but it only needs to conform to
"handler" => "function" format described above.
</para>
</note>
<para>
Each of the individual SAX handler functions are in the format below:
<itemizedlist>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>start_doc</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>end_doc</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>start_element</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam><type>array</type><parameter>attributes</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>end_element</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>start_namespace</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>end_namespace</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>comment</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>pi</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>characters</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
Using <function>xslt_set_sax_handlers</function> doesn't look very different than
running a SAX parser like <function>xml_parse</function> on the result of an
<function>xslt_process</function> transformation.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_set_sax_handlers</function> Example</title>
<programlisting role="php">
</programlisting>
</informalexample>
Where the functions follow the syntax described for the scheme handler
functions.
</para>
<note>
<para>
The given array does not need to contain all of the different sax
handler elements (although it can), but it only needs to conform to
"handler" => "function" format described above.
</para>
</note>
<para>
Each of the individual SAX handler functions are in the format below:
<itemizedlist>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>start_doc</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>end_doc</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>start_element</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam><type>array</type><parameter>attributes</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>end_element</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>start_namespace</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
<methodparam><type>string</type><parameter>uri</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>end_namespace</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>comment</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>pi</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
<listitem>
<simpara>
<methodsynopsis>
<methodname><replaceable>characters</replaceable></methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
</methodsynopsis>
</simpara>
</listitem>
</itemizedlist>
</para>
<para>
Using <function>xslt_set_sax_handlers</function> doesn't look very different than
running a SAX parser like <function>xml_parse</function> on the result of an
<function>xslt_process</function> transformation.
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_set_sax_handlers</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
// From ohlesbeauxjours at yahoo dot fr
// Here's a simple example that applies strtoupper() on
// the content of every <auteur> tag and then displays the
// Here's a simple example that applies strtoupper() on
// the content of every <auteur> tag and then displays the
// resulting XML tree:
$xml='<?xml version="1.0"?>
@ -192,30 +190,30 @@ $xsl='<?xml version="1.0"?>
</xsl:stylesheet>';
// Handlers :
function start_document()
function start_document()
{
// start reading the document
}
function end_document()
function end_document()
{
// end reading the document
}
function start_element($parser, $name, $attributes)
function start_element($parser, $name, $attributes)
{
global $result,$tag;
$result .= "<". $name . ">";
$tag = $name;
}
function end_element($parser, $name)
function end_element($parser, $name)
{
global $result;
$result .= "</" . $name . ">";
}
function characters($parser, $data)
function characters($parser, $data)
{
global $result,$tag;
if ($tag == "auteur" ) {
@ -235,15 +233,15 @@ xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, array("/_xml"=>$xml, "/_xsl"=>
xslt_free($xh);
?>
]]>
</programlisting>
</example>
<para>
You can also use <function>xslt_set_object</function> if you want to
implement your handlers in an object.
</para>
<example>
<title>Object oriented handler</title>
<programlisting role="php">
</programlisting>
</example>
<para>
You can also use <function>xslt_set_object</function> if you want to
implement your handlers in an object.
</para>
<example>
<title>Object oriented handler</title>
<programlisting role="php">
<![CDATA[
<?php
// This is the object oriented version of the previous example
@ -268,14 +266,14 @@ class data_sax_handler {
);
xslt_set_sax_handlers($this->_xh, $handlers);
xslt_process($this->_xh, 'arg:/_xml', 'arg:/_xsl', NULL, array("/_xml"=>$xml, "/_xsl"=>$xsl));
xslt_free($this->_xh);
}
function start_document()
function start_document()
{
// start reading the document
}
@ -303,7 +301,7 @@ class data_sax_handler {
}
$this->buffer .= $data;
}
function get_buffer() {
return $this->buffer;
}
@ -314,11 +312,11 @@ $exec = new data_sax_handler($xml, $xsl);
?>
]]>
</programlisting>
<para>
Both examples will output:
</para>
<screen role="xml">
</programlisting>
<para>
Both examples will output:
</para>
<screen role="xml">
<![CDATA[
<livre>
<auteur>GUSTAVE FLAUBERT</auteur>
@ -327,10 +325,10 @@ $exec = new data_sax_handler($xml, $xsl);
<auteur>VIRGINIA WOOLF</auteur>
</livre>
]]>
</screen>
</example>
</refsect1>
</refentry>
</screen>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.3 -->
<refentry id="function.xslt-set-scheme-handler">
<refnamediv>
<refname>xslt_set_scheme_handler</refname>
<refpurpose>Set Scheme handlers for a XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_scheme_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
Set Scheme handlers on the resource handle given by
<parameter>xh</parameter>. Scheme handlers should be an array with the
format (all elements are optional):
<informalexample>
<programlisting role="php">
<refentry id="function.xslt-set-scheme-handler">
<refnamediv>
<refname>xslt_set_scheme_handler</refname>
<refpurpose>Set Scheme handlers for a XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_scheme_handler</methodname>
<methodparam><type>resource</type><parameter>xh</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
Set Scheme handlers on the resource handle given by
<parameter>xh</parameter>. Scheme handlers should be an array with the
format (all elements are optional):
<informalexample>
<programlisting role="php">
<![CDATA[
array(
[get_all] => get all handler,
@ -28,11 +28,11 @@ array(
[close] => close handler
)
]]>
</programlisting>
</informalexample>
</para>
</refsect1>
</refentry>
</programlisting>
</informalexample>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,25 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/xslt.xml, last change in rev 1.29 -->
<refentry id='function.xslt-set-scheme-handlers'>
<refnamediv>
<refname>xslt_set_scheme_handlers</refname>
<refpurpose>
Set the scheme handlers for the XSLT processor
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_scheme_handlers</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<refentry id='function.xslt-set-scheme-handlers'>
<refnamediv>
<refname>xslt_set_scheme_handlers</refname>
<refpurpose>Set the scheme handlers for the XSLT processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>xslt_set_scheme_handlers</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>array</type><parameter>handlers</parameter></methodparam>
</methodsynopsis>
<para>
&warn.undocumented.func;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,62 +1,60 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.6 $ -->
<refentry id="function.xslt-setopt">
<refnamediv>
<refname>xslt_setopt</refname>
<refpurpose>
Set options on a given xsl processor
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>xslt_setopt</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>int</type><parameter>newmask</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_setopt</function> sets the options specified by
<parameter>newmask</parameter> on the given <parameter>processor</parameter>.
Returns the number of previous mask is possible, &true; otherwise,
&false; in case of an error.
</para>
<para>
<parameter>newmask</parameter> is a bitmask constructed with the following
constants:
<itemizedlist>
<listitem>
<para>
<constant>XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</constant> - Tell the processor
to parse public entities. By default this has been turned off.
</para>
</listitem>
<listitem>
<para>
<constant>XSLT_SABOPT_DISABLE_ADDING_META</constant> - Do not add the meta
tag "Content-Type" for HTML output. The default is set during the compilation
of the processor.
</para>
</listitem>
<listitem>
<para>
<constant>XSLT_SABOPT_DISABLE_STRIPPING</constant> - Suppress the whitespace
stripping (on data files only).
</para>
</listitem>
<listitem>
<para>
<constant>XSLT_SABOPT_IGNORE_DOC_NOT_FOUND</constant> - Consider unresolved
documents (the document() function) non-lethal.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_setopt</function> Example</title>
<programlisting role="php">
<!-- $Revision: 1.7 $ -->
<refentry id="function.xslt-setopt">
<refnamediv>
<refname>xslt_setopt</refname>
<refpurpose>Set options on a given xsl processor</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>xslt_setopt</methodname>
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
<methodparam><type>int</type><parameter>newmask</parameter></methodparam>
</methodsynopsis>
<para>
<function>xslt_setopt</function> sets the options specified by
<parameter>newmask</parameter> on the given <parameter>processor</parameter>.
Returns the number of previous mask is possible, &true; otherwise,
&false; in case of an error.
</para>
<para>
<parameter>newmask</parameter> is a bitmask constructed with the following
constants:
<itemizedlist>
<listitem>
<para>
<constant>XSLT_SABOPT_PARSE_PUBLIC_ENTITIES</constant> - Tell the processor
to parse public entities. By default this has been turned off.
</para>
</listitem>
<listitem>
<para>
<constant>XSLT_SABOPT_DISABLE_ADDING_META</constant> - Do not add the meta
tag "Content-Type" for HTML output. The default is set during the compilation
of the processor.
</para>
</listitem>
<listitem>
<para>
<constant>XSLT_SABOPT_DISABLE_STRIPPING</constant> - Suppress the whitespace
stripping (on data files only).
</para>
</listitem>
<listitem>
<para>
<constant>XSLT_SABOPT_IGNORE_DOC_NOT_FOUND</constant> - Consider unresolved
documents (the document() function) non-lethal.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1>
&reftitle.examples;
<example>
<title><function>xslt_setopt</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -70,16 +68,16 @@ xslt_setopt($xh, xslt_getopt($xh) | XSLT_SABOPT_DISABLE_STRIPPING);
?>
]]>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_getopt</function>.
</para>
</refsect1>
</refentry>
</programlisting>
</example>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>xslt_getopt</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables: