PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<xslt_set_error_handlerxslt_set_object>
Last updated: Mon, 16 Jul 2012

xslt_set_log

(PHP 4 >= 4.0.6, PECL)

xslt_set_log -- Set the log file to write log messages to

Description

void xslt_set_log ( resource xh [, mixed log] )

xh

A reference to the XSLT parser.

log

This parameter is either a boolean value which toggles logging on and off, or a string containing the logfile in which log errors too.

This function allows you to set the file in which you want XSLT log messages to, XSLT log messages are different than error messages, in that log messages are not actually error messages but rather messages related to the state of the XSLT processor. They are useful for debugging XSLT, when something goes wrong.

By default logging is disabled, in order to enable logging you must first call xslt_set_log() with a boolean parameter which enables logging, then if you want to set the log file to debug to, you must then pass it a string containing the filename.

注: 注意如果使用 Windows,需要在路径前加上 file://

例子 1. Using the XSLT Logging features

<?php

$xh
= xslt_create();
xslt_set_log($xh, true);
xslt_set_log($xh, getcwd() . '/myfile.log');

$result = xslt_process($xh, 'dog.xml', 'pets.xsl');
echo
$result;

xslt_free($xh);
?>



<xslt_set_error_handlerxslt_set_object>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST