PHP: xslt_error - Manual

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

search for in the

xslt_free xslt_errno

Last updated: Sat, 27 Jan 2007

view this page in

# xslt_error

(PHP 4 >= 4.0.3, PECL)

xslt_error -- Returns an error string

## Description

string xslt_error ( resource xh )

Returns a string describing the last error that occurred on the passed XSLT processor.

## Примеры

Пример 1. Handling errors using the xslt_error() and xslt_errno() functions.

`<?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);
?>`

## Смотрите также

xslt_errno().

add a note User Contributed Notes
xslt_error
mikes at ayeltd dot biz
05-Jan-2004 05: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);
?>`
add a note
xslt_free xslt_errno

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST