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

search for in the

XSLTProcessor::getParameter> <XSLTProcessor
Last updated: Fri, 13 Nov 2009

view this page in

XSLTProcessor::__construct

(PHP 5)

XSLTProcessor::__construct新規 XSLTProcessor オブジェクトを生成する

説明

__construct ( void )

新規 XSLTProcessor オブジェクトを生成します。

パラメータ

この関数にはパラメータはありません。

返り値

値を返しません。

例1 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
Martin
04-Jun-2009 07:02
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 ]

XSLTProcessor::getParameter> <XSLTProcessor
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites