QXmlStreamReader error on reading empty element
When i parse an XML document using the QXmlStreamReader class, i am presented with an error if i call "readElementText()" on an empty element and my parsing is interrupted. The error is:
Quote:
Expected character data.
Apparently, this is expected behavior.
So how can i know whether an element is empty or not?
Re: QXmlStreamReader error on reading empty element
Some ideas:
- Call readNext() and check if the token is Charactes, i.e. isCharacters() returns true
- Check if calling isEndElement() is true
Cheers,
_