|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-24 13:10 UTC] robert dot dahlin at jerntorget dot se
Description: ------------ xsltApplyOneTemplate is always shown if i have an followed by for example <xsl:if test="object"> in an xsl file. xsltApplyOneTemplate: if was not compiled in (if can for example be apply-template or some other method), i've found that the problem seems to be an directly before the <xsl:if> or what ever "method" is causing the problem. One way to get thru the problem is to use span tags around like : <span> </span> but I don't think that it should be nessesary to do that. Reproduce code: --------------- <td> <xsl:apply-templates select="object"/></td> Expected result: ---------------- <td>(the value of object in xml)</td> Actual result: -------------- Warning: xsltApplyOneTemplate: if was not compiled in /www/include/xslttest.php on line 19 <td>(the value of object in xml)</td> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 20:00:01 2025 UTC |
We have the same problem here. The problem happens when a NBSP is situated before a <xsl:if> statement. Also in the output, even if you enclose the with a <span></span>, there's no 's or spaces.. We've tried defining <!ENTITY nbsp " "> (or #160) but to no avail, we get the same "xsltApplyOneTemplate: if was not compiled in" error. This is with libxml2-2.6.22, libxslt-1.1.15-1 and php-5.0.4 on a fully up to date RedHat Enterprise Server 4. From phpinfo: Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.8, Copyright (c) 2003-2005, by Zend Technologies with Zend Optimizer v2.5.8, Copyright (c) 1998-2004, by Zend Technologies with Zend Debugger v4.0.0, Copyright (c) 1999-2005, by Zend Technologies libXML support active libXML Version 2.6.22 libXML streams enabled XSL enabled libxslt Version 1.1.15 libxslt compiled against libxml Version 2.6.22 EXSLT enabled libexslt Version 1.1.15 This does pose quite a problem to us for our upgrade path to php5, we used sablotron's xslt under php4 for our products, and ofcourse the html templates do contain quite a few  's..Same here, PHP 5.0.5-2ubuntu1.2 (cli). Simple test case: <?php $xsl = "<?xml version=\"1.0\"?> <!DOCTYPE xsl:stylesheet [<!ENTITY whatever \"£\">]> <xsl:stylesheet version=\"1.1\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"> <xsl:template match=\"test\"> <p>&whatever;<xsl:value-of select=\".\"/></p> <p>&whatever;<xsl:apply-templates/></p> <p>&whatever;No problem</p> </xsl:template> </xsl:stylesheet> "; $xml = "<?xml version=\"1.0\"?> <test>Something</test> "; $xmldom = DOMDocument::loadXML($xml); $xsldom = DOMDocument::loadXML($xsl); $xsltproc = new XSLTProcessor(); $xsltproc->importStylesheet($xsldom); echo $xsltproc->transformToXML($xmldom); ?>