Parsing Empty Elements

An empty element is detected by the following code in XMLParser.cpp in the start tag parsing:

To allow for the proper events for empty elements 2 things need to happen:

The adapted code is as follows:

Note There are additional situations where you would need to insert a call to the handler for the end tag.

Only the empty element at the end of the attribute parsing is important to the current example. Empty elements that end in namespaces are not commot.

So to fix, whenever the end of an empty element is detected in XMLParser.cpp, you insert a call to the end tag handler.

One issue is that in parsing the attribute what you have in the qname, local_name, and prefix is for the attribute, not the start tag. So you will need to save these when you parse the start tag. Create fields in the class XMLParser, store the qname, local_name, and prefix when you parse the start tag. Then, use that in parsing the atttribute in a call to the end tag handler. This is a bit tricky, so I will not take off if you don’t have this part of the XMLParser fixed.