mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
49bb81ffbe
commit
b0f713fe3d
1 changed files with 32 additions and 1 deletions
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue