diff --git a/libiqxmlrpc/parser2.cc b/libiqxmlrpc/parser2.cc index 51eebf1..afdd7f1 100644 --- a/libiqxmlrpc/parser2.cc +++ b/libiqxmlrpc/parser2.cc @@ -107,7 +107,7 @@ class Parser::Impl { int sz = static_cast(str.size()); #if (LIBXML_VERSION < 20703) #define XML_PARSE_HUGE 0 -#endif +#endif reader = xmlReaderForMemory(buf2, sz, 0, 0, XML_PARSE_NONET | XML_PARSE_HUGE); xmlTextReaderSetParserProp(reader, XML_PARSER_SUBST_ENTITIES, 0); // No XXE } @@ -185,7 +185,15 @@ class Parser::Impl { std::string tag_name() { - return to_string(xmlTextReaderName(reader)); + std::string rv = to_string(xmlTextReaderName(reader)); + + size_t pos = rv.find_first_of(":"); + if (pos != std::string::npos) + { + rv.erase(0, pos+1); + } + + return rv; } std::string diff --git a/tests/data/request-ns.xml b/tests/data/request-ns.xml new file mode 100644 index 0000000..ba81d6f --- /dev/null +++ b/tests/data/request-ns.xml @@ -0,0 +1,5 @@ + + + system.listMethods + +