chregu Sat Nov 29 11:38:09 2003 EDT
Added files:
/php-src/ext/xsl/tests area_list.xsl area_name.xml bug26384.phpt
Log:
testcase for bug26384
Index: php-src/ext/xsl/tests/area_list.xsl
+++ php-src/ext/xsl/tests/area_list.xsl
<?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" encoding="UTF-8"/>
<xsl:key name="area" match="ROW" use="substring(translate(AREA_NAME, '"',
''), 1, 1)"/>
<xsl:template match="*">
HERE
</xsl:template>
</xsl:stylesheet>
Index: php-src/ext/xsl/tests/area_name.xml
+++ php-src/ext/xsl/tests/area_name.xml
<?xml version="1.0" encoding="UTF-8"?>
<AREA_NAME>
<ROW>
<AREA_CODE>13</AREA_CODE>
<AREA_NAME>"Автово" м.</AREA_NAME>
<AREA_NAME_ENG>m."Avtovo"</AREA_NAME_ENG>
</ROW>
</AREA_NAME>
Index: php-src/ext/xsl/tests/bug26384.phpt
+++ php-src/ext/xsl/tests/bug26384.phpt
--TEST--
Bug #26384 (domxslt->process causes segfault with xsl:key)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new domDocument;
$dom->load(dirname(__FILE__)."/area_name.xml");
if(!$dom) {
echo "Error while parsing the document\n";
exit;
}
$xsl = new domDocument;
$xsl->load(dirname(__FILE__)."/area_list.xsl");
if(!$xsl) {
echo "Error while parsing the document\n";
exit;
}
$proc = new xsltprocessor;
if(!$proc) {
echo "Error while making xsltprocessor object\n";
exit;
}
$proc->importStylesheet($xsl);
print $proc->transformToXml($dom);
//this segfaulted before
print $dom->documentElement->firstChild->nextSibling->nodeName;
--EXPECT--
HERE
ROW
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php