|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57280 option to return end tag instead of isEmptyElement
Submitted: 2006-10-05 06:41 UTC Modified: 2006-10-05 07:05 UTC
From: skissane at gmail dot com Assigned:
Status: Not a bug Package: xmlReader (PECL)
PHP Version: 5.1.4 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: skissane at gmail dot com
New email:
PHP Version: OS:


 [2006-10-05 06:41 UTC] skissane at gmail dot com
My life (and my code) would be so much easier if there was an option to make xmlreader do what I would expect, which is return two nodes for an empty tag -- one start, one end -- rather than just a start node with isEmptyElement. Probably this would need to be a flag of some sort, because people may have written code which relies on the current behaviour, as broken (in my view) as it is.

The problem is suppose I write some code to parse the XML document: <foo></foo>. I could write code that checks for the </foo> tag, and that works fine. Someone else then changes that to: <foo/>. Suddenly my code isn't working.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-05 07:05 UTC]
Thank you for taking the time to write to us, but this is not
a bug.

That is the expected behavior (see docs at or even .NET documentation). An empty element tag is a specific type of tag in XML. You need to handle both cases in your code.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 18:01:29 2024 UTC