note 79257 modified in function.xsl-xsltprocessor-import-stylesheet by danbrown

From: Date: Fri, 28 Nov 2008 22:12:02 +0000
Subject: note 79257 modified in function.xsl-xsltprocessor-import-stylesheet by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147311@lists.php.net to get a copy of this message
Just for reference, as of this writing, this function does not support importing multiple stylesheets. The following will output only the stylesheet transformation of the second imported sheet: <?php # LOAD XML FILE $XML = new DOMDocument(); $XML->load( 'data.xml' ); # START XSLT $xslt = new XSLTProcessor(); # IMPORT STYLESHEET 1 $XSL = new DOMDocument(); $XSL->load( 'template1.xsl' ); $xslt->importStylesheet( $XSL ); #IMPORT STYLESHEET 2 $XSL = new DOMDocument(); $XSL->load( 'template2.xsl' ); $xslt->importStylesheet( $XSL ); #PRINT print $xslt->transformToXML( $XML ); ?> This wasn't documented and quite dissapointing. --was-- Just for reference, as of this writing, this function does not support importing multiple stylesheets. The following will output only the stylesheet transformation of the second imported sheet: <?php # LOAD XML FILE $XML = new DOMDocument(); $XML->load( 'data.xml' ); # START XSLT $xslt = new XSLTProcessor(); # IMPORT STYLESHEET 1 $XSL = new DOMDocument(); $XSL->load( 'template1.xsl' ); $xslt->importStylesheet( $XSL ); #IMPORT STYLESHEET 2 $XSL = new DOMDocument(); $XSL->load( 'template2.xsl' ); $xslt->importStylesheet( $XSL ); #PRINT print $xslt->transformToXML( $XML ); ?> This wasn't documented and quite dissapointing. http://php.net/manual/en/function.xsl-xsltprocessor-import-stylesheet.php

« previous php.notes (#147311) next »