From: edwin at bitstorm dot org
Operating system: Ubuntu 9.04
PHP version: 5.2SVN-2009-11-12 (SVN)
PHP Bug Type: XML Reader
Bug description: Empty element should also return END_ELEMENT
Description:
------------
Element <a></a> returns twice, one for XMLReader::ELEMENT and one for
XMLReader::END_ELEMENT.
Element <a/> returns once, for XMLReader::ELEMENT.
That should return a XMLReader::END_ELEMENT too, because that's implicit.
Problem is that now you can't distinguish between <a><b> and <a/><b> and
that's a bug.
Reproduce code:
---------------
$reader = new XMLReader();
$reader->open($file);
echo "<table>\n";
while ($reader->read()) {
echo "<tr><td>".$reader->nodeType."</td><td>".$node =
$reader->name."</td><td>".$reader->value."</td></tr>\n";
}
echo "</table>\n";
Input:
<Titles>
<Title>
<ID>429</ID>
<Type />
<Barcode>
</Barcode>
Expected result:
----------------
1 Titles
14 #text
1 Title
14 #text
1 ID
3 #text 429
15 ID
14 #text
1 Type
14 #text
15 Type
14 #text
1 Barcode
14 #text
15 Barcode
14 #text
Actual result:
--------------
1 Titles
14 #text
1 Title
14 #text
1 ID
3 #text 429
15 ID
14 #text
1 Type
14 #text
1 Barcode
14 #text
15 Barcode
14 #text
--
Edit bug report at http://bugs.php.net/?id=50156&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50156&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50156&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50156&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50156&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50156&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50156&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50156&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50156&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50156&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50156&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50156&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50156&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50156&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50156&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50156&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50156&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50156&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50156&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50156&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50156&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50156&r=mysqlcfg