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: Mon, 20 May 2013

view this page in

xslt_error

(PHP 4 >= 4.0.3)

xslt_errorRestituisce una stringa di errore

Descrizione

string xslt_error ( resource $xh )

Restituisce una stringa che descrive l'ultimo errore che si รจ verificato sul processore XSLT passato.

Elenco dei parametri

xh

The XSLT processor link identifier, created with xslt_create().

Valori restituiti

Restituisce il messaggio di errore, come una stringa.

Esempi

Example #1 Gestione degli errori utilizzando le funzioni xslt_error() e xslt_errno().

<?php

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

echo 
$result;

xslt_free($xh);
?>

Vedere anche:



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 | sitemap | contact | advertising | mirror sites