summaryrefslogtreecommitdiff
path: root/src/plugins/xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/xml')
-rw-r--r--src/plugins/xml/XmlParser.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp
index ce2857e..824219a 100644
--- a/src/plugins/xml/XmlParser.cpp
+++ b/src/plugins/xml/XmlParser.cpp
@@ -20,7 +20,7 @@
#include <expat.h>
-#include <core/Utils.hpp>
+#include <core/common/Utils.hpp>
#include <core/parser/ParserStack.hpp>
#include "XmlParser.hpp"
@@ -204,11 +204,15 @@ Rooted<Node> XmlParser::parse(std::istream &is, ParserContext &ctx)
// Parse the data and handle any XML error
if (!XML_ParseBuffer(&p, bytesRead, bytesRead == 0)) {
- const int line = XML_GetCurrentLineNumber(&p);
- const int column = XML_GetCurrentColumnNumber(&p);
+ const TextCursor::PosType line =
+ static_cast<TextCursor::PosType>(XML_GetCurrentLineNumber(&p));
+ const TextCursor::PosType column = static_cast<TextCursor::PosType>(
+ XML_GetCurrentColumnNumber(&p));
+ const size_t offs = XML_GetCurrentByteIndex(&p);
const XML_Error code = XML_GetErrorCode(&p);
const std::string msg = std::string{XML_ErrorString(code)};
- throw ParserException{"XML Syntax Error: " + msg, line, column};
+ throw ParserException{"XML Syntax Error: " + msg, line, column,
+ offs};
}
// Abort once there are no more bytes in the stream