php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51156 xsl:call-template warning
Submitted: 2010-02-26 13:58 UTC Modified: 2014-12-30 10:41 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: matthes at leuffen dot de Assigned:
Status: No Feedback Package: XSLT related
PHP Version: 5.2.13 OS: Ubuntu Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
24 - 10 = ?
Subscribe to this entry?

 
 [2010-02-26 13:58 UTC] matthes at leuffen dot de
Description:
------------
When using XSLT there is a PHP Warning triggered on every <xsl:with-param/> Element.

The Result is as expected (it is an annoying message).

(The Warning occurs also when using <xsl:with-param name="xy" select="'string'"/>)  


Reproduce code:
---------------
--Stylesheet--
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet  [
]>
<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">    
	<xsl:output method="html" xml:space="preserve" indent="yes" encoding="UTF-8"/>

	<xsl:template name="TestTemplate">
		<xsl:param name="Param1"/>
		<xsl:text>Parameter1 Value: </xsl:text><xsl:copy-of select="$Param1"/>
	</xsl:template>
	
	<xsl:template match="/Test">
		<xsl:call-template name="TestTemplate">
			<xsl:with-param name="Param1">testOutput to print</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
</xsl:stylesheet>
--/Stylesheet--

--PHP Code--
<?php
$data = <<<EOT
<Test></Test>
EOT;

$xml = new DOMDocument("1.0", "UTF-8");
$xml->loadXML($data);
$proc = new XSLTProcessor();
$xslp = new DOMDocument();
$xslp->load("test.xsl");
$proc->importStyleSheet($xslp);

echo $proc->transformToXml($xml);
--/PHP Code--

Expected result:
----------------
Parameter1 Value: 'testOutput to print' 

Actual result:
--------------
Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]: xsl:call-template: misplaced text element in /home/matthes/Projects/FuPShop/tmp/transform.php on line 23

Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]: xsl:call-template: misplaced text element in /home/matthes/Projects/FuPShop/tmp/transform.php on line 23
Parameter1 Value: 'testOutput to print' 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-02 11:41 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2013-12-02 11:41 UTC] mike@php.net
Cannot reproduce. Maybe fixed in current libxslt and/or PHP.
 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 00:01:34 2024 UTC