2004-05-19 16:01:20 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2005-06-24 09:11:47 +00:00
|
|
|
<!-- $Revision: 1.6 $ -->
|
2004-05-19 16:01:20 +00:00
|
|
|
<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>
|
2005-06-24 09:11:47 +00:00
|
|
|
<type>bool</type><methodname>xslt_set_object</methodname>
|
2004-07-30 13:51:43 +00:00
|
|
|
<methodparam><type>resource</type><parameter>processor</parameter></methodparam>
|
2004-11-10 08:30:50 +00:00
|
|
|
<methodparam><type>object</type><parameter role="reference">obj</parameter></methodparam>
|
2004-05-19 16:01:20 +00:00
|
|
|
</methodsynopsis>
|
2004-07-30 13:51:43 +00:00
|
|
|
<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>
|
2004-08-03 14:33:40 +00:00
|
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
|
|
&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 {
|
|
|
|
|
|
|
|
var $_xh; // our XSLT processor
|
|
|
|
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
2004-08-03 14:33:40 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
2004-05-19 16:01:20 +00:00
|
|
|
</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:"../../../../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
|
|
|
|
-->
|