summaryrefslogtreecommitdiff
path: root/src/formats/osxml
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-18 16:33:52 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-18 16:33:52 +0100
commitb612660c075030370017e3ba14eaf152fd4fa947 (patch)
tree3c0998db8c35837e543dffcf7e67c2a5348cc659 /src/formats/osxml
parent792357cb81ffa8b2f4fe5c16b1e359d8e51a53ae (diff)
ignored xmlns attributes in root tag in xml parsing.
Diffstat (limited to 'src/formats/osxml')
-rw-r--r--src/formats/osxml/OsxmlEventParser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/formats/osxml/OsxmlEventParser.cpp b/src/formats/osxml/OsxmlEventParser.cpp
index 788f376..c9254b0 100644
--- a/src/formats/osxml/OsxmlEventParser.cpp
+++ b/src/formats/osxml/OsxmlEventParser.cpp
@@ -253,6 +253,12 @@ static void xmlStartElementHandler(void *ref, const XML_Char *name,
// Convert the C string to a std::string
const std::string key{*(attr++)};
+ // Ignore xml namespace declarations
+ if (Utils::startsWith(key, "xmlns:") && parser->getData().depth == 1) {
+ attr++;
+ continue;
+ }
+
// Search the location of the key
SourceLocation keyLoc;
auto it = attributeOffsets.find(key);