xslt_create Create a new XSLT processor php函数


xslt_create

(PHP 4 >= 4.0.3)

xslt_createCreate a new XSLT processor

说明

resource xslt_create ( void )

Create and return a new XSLT processor resource for manipulation by the other XSLT functions.

返回值

Returns an XSLT processor link identifier on success, or FALSE on error.

范例

Example #1 xslt_create() example

<?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;
}
?>

参见



相关阅读:
xslt_errno Returns an error number
xslt_error Returns an error string
xslt_free Free XSLT processor
xslt_getopt Get options on a given xsl processor
xslt_process Perform an XSLT transformation
xslt_setopt Set options on a given XSLT processor
xslt_set_base Set the base URI for all XSLT transformations
xslt_set_encoding Set the encoding for the parsing of XML documents
xslt_set_error_handler Set an error handler for a XSLT processor
xslt_set_log Set the log file to write log messages to
xslt_set_object Sets the object in which to resolve callback functions
xslt_set_sax_handler Set SAX handlers for a XSLT processor
xslt_set_sax_handlers Set the SAX handlers to be called when the XML document gets processed
xslt_set_scheme_handler Set Scheme handlers for a XSLT processor
快速导航

Copyright © 2016 phpStudy |