|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-16 13:09 UTC] tony2001@php.net
[2006-02-16 13:13 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 12:00:01 2025 UTC |
Description: ------------ A simple xslt stylesheet used on a production website with php 5.0.4 doesn't work more since we installed php 5.1.2.? Reproduce code: --------------- PHP code: public function loadXslFile(filewrapper $xslFile) { $this->xslDom->load( $xslFile->getFileName() ); $this->xslProcessor->importStylesheet( $this->xslDom ); } XSLT file: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes" omit-xml-declaration="yes" /> <xsl:strip-space elements="*" /> <xsl:param name="current"/> <xsl:template match="node[@id=$current]"> <xsl:if test="not(@id='home')"> :: <xsl:value-of select="@title" /> </xsl:if> </xsl:template> </xsl:stylesheet> Expected result: ---------------- The XSLT is expected to return the title attribute of a node element which id matches 'current' param value. Actual result: -------------- We obtain the message: XSLTProcessor::importStylesheet() [function.importStylesheet]: Undefined variable Trying to extend the scope of xsl:param to enclose the whole template will result in: XSLTProcessor::importStylesheet() [function.importStylesheet]: compilation error: file D:/InetPub/wwwroot/www.uniroma3.it/xml/pagetitle.xsl line 6 element template