34 std::map<std::string, std::string> metadata;
36 Poco::XML::NodeIterator it(
pDoc, Poco::XML::NodeFilter::SHOW_ELEMENT);
37 Poco::XML::Node *pNode = it.nextNode();
40 Poco::AutoPtr<Poco::XML::NodeList> children = pNode->childNodes();
41 if (children->length() == 1 && std::find(std::begin(tags_to_ignore), std::end(tags_to_ignore), pNode->nodeName()) ==
42 std::end(tags_to_ignore)) {
43 std::string key = pNode->parentNode()->nodeName() +
"/" + pNode->nodeName();
44 std::string
value = pNode->innerText();
45 boost::algorithm::trim(
value);
46 metadata.emplace(key,
value);
48 pNode = it.nextNode();
64 std::map<std::string, std::string> attributes_map;
65 Poco::XML::NodeIterator it(
pDoc, Poco::XML::NodeFilter::SHOW_ELEMENT);
66 Poco::XML::Node *pNode = it.nextNode();
67 Poco::XML::Node *detectorNode = pNode->getNodeByPath(xpath);
69 Poco::AutoPtr<Poco::XML::NamedNodeMap> attributes = detectorNode->attributes();
70 for (
unsigned int i = 0; i < attributes->length(); i++) {
71 Poco::XML::Node *attribute = attributes->item(i);
72 attributes_map.emplace(attribute->nodeName(), attribute->nodeValue());
75 return attributes_map;
85 std::vector<std::string> subnodes;
86 Poco::XML::Node *xpathNode =
pDoc->getNodeByPath(xpath);
88 Poco::XML::NodeIterator it(xpathNode, Poco::XML::NodeFilter::SHOW_ELEMENT);
89 Poco::XML::Node *pNode = it.nextNode();
92 Poco::AutoPtr<Poco::XML::NodeList> children = pNode->childNodes();
93 if (children->length() == 1) {
94 subnodes.emplace_back(pNode->nodeName());
96 pNode = it.nextNode();