#22345 [Opn->Bgs]: XSL error when evaluating an empty path
| From: | reedc at aap dot com dot au | Date: | Fri, 21 Feb 2003 06:41:45 +0000 |
| Subject: | #22345 [Opn->Bgs]: XSL error when evaluating an empty path | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-33780@lists.php.net to get a copy of this message | ||
ID: 22345
User updated by: reedc at aap dot com dot au
Reported By: reedc at aap dot com dot au
-Status: Open
+Status: Bogus
Bug Type: XSLT related
Operating System: Windows 2000
PHP Version: 5CVS-2003-02-20 (dev)
New Comment:
This is not an error with XSLT. It is an error with my brain (and
code).
Apologies ... and thanks.
Previous Comments:
------------------------------------------------------------------------
[2003-02-20 22:15:35] reedc at aap dot com dot au
xslt_process() chucks an undefined (no error text) error when an xpath
selection is not found. The result should be empty.
For instance, if you were trying to use this stylesheet:
_________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:for-each select="peas/porridge/ninedaysold">
<xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
________________________________________________________
on the following xml:
_________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<peas>
<porridge>
<hot>yes</hot>
<cold>no</cold>
<inadish>no</inadish>
</porridge>
</peas>
______________________________________________
The result should be nothing. Instead the process chucks an error.
If you use other XSL selections to find the same thing conditionally,
such as xsl:if, the result is the same.
If XML elements are optional, then any file not containing them will
cause an error with the current php_xslt.dll
The XML/XSL files that produce an error with PHP5x (latest snap). Have
worked fine with the past several interations of PHP 4x.
PHP: 5x
Apache 2
Sablotron: 0.97
Thanks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22345&edit=1