added example and see also

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@138208 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Heilig (Cece) Szabolcs 2003-08-18 21:54:12 +00:00
parent 49bb81ffbe
commit b0f713fe3d

View file

@ -1,5 +1,5 @@
<?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-create">
<refnamediv>
@ -16,6 +16,37 @@
Create and return a new XSLT processor resource for manipulation by the
other XSLT functions.
</para>
<para>
</para>
<example>
<title><function>xslt_create</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
function xml2html($xmldata,$xsl) {
/* $xmldata -> your xml */
/* $xsl -> xslt file */
$path = 'include';
$arguments = array('/_xml' => $xmldata);
$xsltproc = xslt_create();
xslt_set_encoding($xsltproc, 'ISO-8859-1');
$html =
xslt_process($xsltproc,'arg:/_xml',"$path/$xsl",NULL,$arguments);
if (empty($html)) {
die('XSLT processing error: '.xslt_error($xsltproc));
}
xslt_free($xsltproc);
return $html;
}
?>
]]>
</programlisting>
</example>
<para>
See also <function>xslt_free</function>.
</para>
</refsect1>
</refentry>