php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36369 built in templates pass parameters through in conflict to rfc
Submitted: 2006-02-11 23:47 UTC Modified: 2006-02-12 13:03 UTC
From: bugs at forestfactory dot de Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 5.1.2 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bugs at forestfactory dot de
New email:
PHP Version: OS:

 

 [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"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-12 00:00 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-02-12 00:29 UTC] bugs at forestfactory dot de
<?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>'));
?>
 [2006-02-12 00:34 UTC] bugs at forestfactory dot de
I'm sorry, but the line breaks broke the testcase. Please remove them.
 [2006-02-12 09:20 UTC] sniper@php.net
Provide the test as downloadable zip somewhere.
 [2006-02-12 13:03 UTC] chregu@php.net
libxslt (resp. xsltproc) behaves the same, therefore it's not a PHP issue. Please file a bug report on the libxslt site, if you still think, this is an issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 16:01:29 2024 UTC