From b612660c075030370017e3ba14eaf152fd4fa947 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 18 Feb 2015 16:33:52 +0100 Subject: ignored xmlns attributes in root tag in xml parsing. --- src/formats/osxml/OsxmlEventParser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/formats') 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); -- cgit v1.2.3