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

search for in the

XSLTProcessor::getParameter> <XSLTProcessor
[edit] Last updated: Fri, 07 Jun 2013

view this page in

XSLTProcessor::__construct

(PHP 5)

XSLTProcessor::__constructCrea un nuevo objeto XSLTProcessor

Descripción

XSLTProcessor::__construct() ( void )

Crea un nuevo objeto XSLTProcessor.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

No devuelve ningún valor.

Ejemplos

Ejemplo #1 Creando un XSLTProcessor

<?php

$doc 
= new DOMDocument();
$xsl = new XSLTProcessor();

$doc->load($xsl_filename);
$xsl->importStyleSheet($doc);

$doc->load($xml_filename);
echo 
$xsl->transformToXML($doc);

?>



add a note add a note User Contributed Notes XSLTProcessor::__construct - [1 notes]
up
0
Martin
4 years ago
The example above is a bit confusing because it uses the same variable ($doc) for two different things. I would rather write

<?php

$xsl
= new XSLTProcessor();
$xsldoc = new DOMDocument();
$xsldoc->load($xsl_filename);
$xsl->importStyleSheet($xsldoc);

$xmldoc = new DOMDocument();
$xmldoc->load($xml_filename);
echo
$xsl->transformToXML($xmldoc);

?>

[ Editor's note - thiago AT php DOT net: This note has improvements from Matthieu ]

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