go to bug id or search bugs for
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
Add a Pull Request
Thank you for taking the time to write to us, but this is not
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.