diff --git a/src/Base/Reader.cpp b/src/Base/Reader.cpp index 2116afbed3..f172b18c78 100644 --- a/src/Base/Reader.cpp +++ b/src/Base/Reader.cpp @@ -181,6 +181,8 @@ bool Base::XMLReader::read() void Base::XMLReader::readElement(const char* ElementName) { bool ok {}; + + endCharStream(); int currentLevel = Level; std::string currentName = LocalName; do { @@ -248,6 +250,8 @@ bool Base::XMLReader::isEndOfDocument() const void Base::XMLReader::readEndElement(const char* ElementName, int level) { + endCharStream(); + // if we are already at the end of the current element if ((ReadType == EndElement || ReadType == StartEndElement) && ElementName && LocalName == ElementName && (level < 0 || level == Level)) {