2010-03-29 09:53:08 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2009-07-11 09:23:09 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.xslt-set-object" xmlns="http://docbook.org/ns/docbook">
|
2007-06-11 00:05:00 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>xslt_set_object</refname>
|
|
|
|
<refpurpose>Sets the object in which to resolve callback functions</refpurpose>
|
|
|
|
</refnamediv>
|
2007-06-11 00:05:27 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-06-11 00:05:00 +00:00
|
|
|
<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
|
2009-05-26 07:15:06 +00:00
|
|
|
<function>xslt_set_sax_handlers</function>,
|
2007-06-11 00:05:00 +00:00
|
|
|
<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>
|
2007-06-11 00:05:27 +00:00
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>processor</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The XSLT processor link identifier, created with
|
|
|
|
<function>xslt_create</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>obj</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
An object.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
&return.success;
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1 role="description">
|
2007-06-11 00:05:00 +00:00
|
|
|
&reftitle.examples;
|
|
|
|
<example>
|
|
|
|
<title>Using your own error handler as a method</title>
|
|
|
|
<programlisting role="php">
|
2004-07-30 13:51:43 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-05-19 16:01:20 +00:00
|
|
|
|
2004-07-30 13:51:43 +00:00
|
|
|
class my_xslt_processor {
|
2007-06-11 00:05:00 +00:00
|
|
|
|
2004-07-30 13:51:43 +00:00
|
|
|
var $_xh; // our XSLT processor
|
2007-06-11 00:05:00 +00:00
|
|
|
|
2004-07-30 13:51:43 +00:00
|
|
|
function my_xslt_processor()
|
|
|
|
{
|
|
|
|
$this->_xh = xslt_create();
|
2004-05-19 16:01:20 +00:00
|
|
|
|
2004-07-30 13:51:43 +00:00
|
|
|
// Make $this object the callback resolver
|
|
|
|
xslt_set_object($this->_xh, $this);
|
|
|
|
|
|
|
|
// Let's handle the errors
|
|
|
|
xslt_set_error_handler($this->_xh, "my_xslt_error_handler");
|
|
|
|
}
|
|
|
|
|
|
|
|
function my_xslt_error_handler($handler, $errno, $level, $info)
|
|
|
|
{
|
|
|
|
// for now, let's just see the arguments
|
|
|
|
var_dump(func_get_args());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
2007-06-11 00:05:00 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</refsect1>
|
2007-06-11 00:05:27 +00:00
|
|
|
|
2007-06-11 00:05:00 +00:00
|
|
|
</refentry>
|
2004-05-19 16:01:20 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2004-05-19 16:01:20 +00:00
|
|
|
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
|
|
|
|
-->
|