summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/LibXMLParser.cpp')
-rw-r--r--Swiften/Parser/LibXMLParser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Swiften/Parser/LibXMLParser.cpp b/Swiften/Parser/LibXMLParser.cpp
index c9f3a07..192f44b 100644
--- a/Swiften/Parser/LibXMLParser.cpp
+++ b/Swiften/Parser/LibXMLParser.cpp
@@ -24,7 +24,7 @@ struct LibXMLParser::Private {
24 xmlParserCtxtPtr context_; 24 xmlParserCtxtPtr context_;
25}; 25};
26 26
27static void handleStartElement(void* parser, const xmlChar* name, const xmlChar*, const xmlChar* xmlns, int, const xmlChar**, int nbAttributes, int nbDefaulted, const xmlChar ** attributes) { 27static void handleStartElement(void* parser, const xmlChar* name, const xmlChar*, const xmlChar* xmlns, int nbNamespaces, const xmlChar** namespaces, int nbAttributes, int nbDefaulted, const xmlChar ** attributes) {
28 AttributeMap attributeValues; 28 AttributeMap attributeValues;
29 if (nbDefaulted != 0) { 29 if (nbDefaulted != 0) {
30 // Just because i don't understand what this means yet :-) 30 // Just because i don't understand what this means yet :-)
@@ -42,6 +42,11 @@ static void handleStartElement(void* parser, const xmlChar* name, const xmlChar*
42 std::string(reinterpret_cast<const char*>(attributes[i+3]), 42 std::string(reinterpret_cast<const char*>(attributes[i+3]),
43 static_cast<size_t>(attributes[i+4]-attributes[i+3]))); 43 static_cast<size_t>(attributes[i+4]-attributes[i+3])));
44 } 44 }
45 for (auto i = 0; i < nbNamespaces * 2; i += 2) {
46 const auto prefix = namespaces[i] ? std::string(reinterpret_cast<const char*>(namespaces[i])) : "";
47 const auto uri = std::string(reinterpret_cast<const char*>(namespaces[i + 1]));
48 static_cast<XMLParser*>(parser)->getClient()->handleNamespaceDeclaration(prefix, uri);
49 }
45 static_cast<XMLParser*>(parser)->getClient()->handleStartElement(reinterpret_cast<const char*>(name), (xmlns ? reinterpret_cast<const char*>(xmlns) : std::string()), attributeValues); 50 static_cast<XMLParser*>(parser)->getClient()->handleStartElement(reinterpret_cast<const char*>(name), (xmlns ? reinterpret_cast<const char*>(xmlns) : std::string()), attributeValues);
46} 51}
47 52