From: maximchick at gmail dot com
Operating system: Gentoo Linux
PHP version: 5.2.5
PHP Bug Type: XSLT related
Bug description: xsl:document('') function gaves unexpected result on
automatically generated te
Description:
------------
Take a look on a bug: http://bugs.php.net/bug.php?id=43289
which was incorrectly marked as "bogus"
I'm talking exactly what i'm talking. Please double check what the
function document('') should do.
take attention to the line:
$xpath->query('//xsl:stylesheet')->item(0)->appendChild($xpath->query('/
/xsl:template')->item(0)->cloneNode(true));
which clones xsl:template node, so we have two <xsl:template match="/">
nodes in result template, and you're right only one will match, BUT this
template parses ITSELF:
<xsl:for-each select="document('')//xsl:*">
You can comment line:
//$xml->load('/tmp/template.xsl');
to have a little understanding what i'm talking about.
So, it should find TWO <xsl:template match="/"/> nodes, and output should
be:
xsl:stylesheet
xsl:output
xsl:template
xsl:for-each
xsl:value-of
xsl:text
xsl:template
xsl:for-each
xsl:value-of
xsl:text
And i surprize you: when the template DOM initialized by
DOMDocument::loadXML() instead of DOMDocument::load() it gave the expected
output.
--
Edit bug report at http://bugs.php.net/?id=43299&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43299&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43299&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43299&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43299&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43299&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43299&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43299&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43299&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43299&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43299&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43299&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43299&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43299&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43299&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43299&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43299&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43299&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43299&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43299&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43299&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43299&r=mysqlcfg