|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-02-11 23:47 UTC] bugs at forestfactory dot de
Description: ------------ As of http://www.w3.org/TR/xslt#built-in-rule, the built in templates should just call any subordinated templates, but in PHP it passes parameters through. Reproduce code: --------------- (to be short, this are just XML fragments) XML: <first> <second> <third/> </second> </first> XSLT: <template match="first"> <apply-template select="second"> <with-param name="foo" select="'bar'"/> </apply-template> </template> <template match="third"> <param name="foo"/> <value-of select="$foo"/> </template> Expected result: ---------------- No output as $foo should not be set. Actual result: -------------- Outputs "bar" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 09:00:01 2025 UTC |
<?php // Testcase header('Content-type: text/xml'); $xsltProcessor = new XSLTProcessor(); $xsltProcessor->importStylesheet(DOMDocument::loadXML('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><output><xsl:apply-templates/></output></xsl:template><xsl:template match="first"><xsl:apply-templates select="second"><xsl:with-param name="foo" select="\'bar\'"/></xsl:apply-templates></xsl:template><xsl:template match="third"><xsl:param name="foo"/><param><xsl:value-of select="$foo"/></param></xsl:template></xsl:stylesheet>')); echo $xsltProcessor->transformToXML(DOMDocument::loadXML('<root><first><second><third/></second></first></root>')); ?>