From 66a98861d0fbb7cba742b63bf97268a2a619c5e0 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Sat, 10 Aug 2024 15:51:34 +0200 Subject: Some small updates here and there --- src/recvkv6/main.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/recvkv6/main.cpp') diff --git a/src/recvkv6/main.cpp b/src/recvkv6/main.cpp index 3a3338b..e8b0ba3 100644 --- a/src/recvkv6/main.cpp +++ b/src/recvkv6/main.cpp @@ -922,20 +922,22 @@ struct Kv6Parser { std::optional parse(const rapidxml::xml_document<> &doc) { std::optional msg; - for (const rapidxml::xml_node<> *node = doc.first_node(); node; node = node->next_sibling()) { - ifTmi8Element(*node, nullptr /* nss */, [&](std::string_view name, const Xmlns *nss) { - if (name == "VV_TM_PUSH") { - if (msg) { - error("Duplicated VV_TM_PUSH"); - return; - } - msg = parseVvTmPush(*node, nss); - if (!msg) { - error("Invalid VV_TM_PUSH"); + withXmlnss(doc.first_attribute(), nullptr /* nss */, [&](const Xmlns *nss) { + for (const rapidxml::xml_node<> *node = doc.first_node(); node; node = node->next_sibling()) { + ifTmi8Element(*node, nss, [&](std::string_view name, const Xmlns *node_nss) { + if (name == "VV_TM_PUSH") { + if (msg) { + error("Duplicated VV_TM_PUSH"); + return; + } + msg = parseVvTmPush(*node, node_nss); + if (!msg) { + error("Invalid VV_TM_PUSH"); + } } - } - }); - } + }); + } + }); if (!msg) error("Expected to find VV_TM_PUSH"); return msg; -- cgit v1.2.3