downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

xslt_free> <xslt_errno
Last updated: Fri, 03 Sep 2010

view this page in

xslt_error

(PHP 4 >= 4.0.3)

xslt_errorエラー文字列を返す

説明

string xslt_error ( resource $xh )

指定した XSLT プロセッサで発生した直近のエラーを説明する文字列を返します。

パラメータ

xh

xslt_create() で作成した XSLT プロセッサリンク ID。

返り値

エラーメッセージを表す文字列を返します。

例1 関数 xslt_error() および xslt_errno() によるエラー処理

<?php

$xh 
xslt_create();
$result xslt_process($xh'dog.xml''pets.xsl');
if (!
$result) {
    die(
sprintf("Cannot process XSLT document [%d]: %s",
                
xslt_errno($xh), xslt_error($xh)));
}

echo 
$result;

xslt_free($xh);
?>

参考



add a note add a note User Contributed Notes
xslt_error
mikes at ayeltd dot biz
05-Jan-2004 01:18
There may be cases where a null $result is legitimate, in this case add a test for non-zero xlst_errno:

<?php

$xh
= xslt_create();
$result = xslt_process($xh, 'dog.xml', 'pets.xsl');
if (!
$result && xslt_errno($xh) > 0) {
   die(
sprintf("Cannot process XSLT document [%d]: %s",
              
xslt_errno($xh), xslt_error($xh)));
}

echo
$result;

xslt_free($xh);
?>

xslt_free> <xslt_errno
Last updated: Fri, 03 Sep 2010
 
 
show source | credits | sitemap | contact | advertising | mirror sites