|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-12 21:02 UTC] edwin at bitstorm dot org
[2009-11-12 21:14 UTC] edwin at bitstorm dot org
[2009-11-24 16:14 UTC] edwin at bitstorm dot org
[2009-11-25 16:08 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
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