cece Mon Aug 18 17:54:13 2003 EDT Modified files: /phpdoc/en/reference/xslt/functions xslt-create.xml Log: added example and see also Index: phpdoc/en/reference/xslt/functions/xslt-create.xml diff -u phpdoc/en/reference/xslt/functions/xslt-create.xml:1.3 phpdoc/en/reference/xslt/functions/xslt-create.xml:1.4 --- phpdoc/en/reference/xslt/functions/xslt-create.xml:1.3 Wed May 1 15:04:33 2002 +++ phpdoc/en/reference/xslt/functions/xslt-create.xml Mon Aug 18 17:54:12 2003 @@ -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> @@ -15,6 +15,37 @@ <para> 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>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php