php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: skissane at gmail dot com
New email:
PHP Version: OS:

 

 [2006-10-05 06:41 UTC] skissane at gmail dot com
Description:
------------
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.


Patches

Pull Requests

History

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

That is the expected behavior (see docs at xmlsoft.org 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: Sun Dec 22 11:01:30 2024 UTC