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

search for in the

xslt_free> <xslt_errno
[edit] Last updated: Fri, 24 Jun 2011

view this page in

xslt_error

(PHP 4 >= 4.0.3)

xslt_errorبازگرداندن رشته خطا

Description

string xslt_error ( resource $xh )

بازگرداندن رشته توضیح‌دهنده آخرین خطای اتفاق افتاده در پردازشگر ارسالی XSLT.

Parameters

xh

شناساگر پیوند پردازش‌گر XSLT ساخته شده توسط xslt_create().

Return Values

بازگرداندن پیام خطا به عنوان رشته.

Examples

Example #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);
?>

See Also



add a note add a note User Contributed Notes xslt_error - [1 notes]
up
0
mikes at ayeltd dot biz
9 years ago
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);
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites