#22345 [NEW]: XSL error when evaluating an empty path
| From: | reedc at aap dot com dot au | Date: | Fri, 21 Feb 2003 04:15:35 +0000 |
| Subject: | #22345 [NEW]: XSL error when evaluating an empty path | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-33775@lists.php.net to get a copy of this message | ||
From: reedc at aap dot com dot au
Operating system: Windows 2000
PHP version: 5CVS-2003-02-20 (dev)
PHP Bug Type: XSLT related
Bug description: XSL error when evaluating an empty path
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 bug report at http://bugs.php.net/?id=22345&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22345&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22345&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22345&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22345&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22345&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22345&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22345&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22345&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22345&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22345&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22345&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22345&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22345&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22345&r=gnused