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, 17 May 2013

view this page in

xslt_error

(PHP 4 >= 4.0.3)

xslt_errorDevuelve una cadena de errores

Descripción

string xslt_error ( resource $xh )

Devuelve una cadena que describe el último error que ocurrió en el procesador XSLT proporcionado.

Parámetros

xh

El identificador de enlace del procesador XSLT, creado con xslt_create().

Valores devueltos

Devuelve el mensaje de error, como una cadena.

Ejemplos

Ejemplo #1 Manejo de errores utilizando las funciones xslt_error() y xslt_errno().

<?php

$xh 
xslt_create();
$result xslt_process($xh'dog.xml''pets.xsl');
if (!
$result) {
    die(
sprintf("No se pudo procesar el documente XSLT [%d]: %s",
                
xslt_errno($xh), xslt_error($xh)));
}

echo 
$result;

xslt_free($xh);
?>

Ver también



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