23 std::stringstream strStream;
24 Poco::XML::DOMWriter writer;
25 writer.setNewLine(
"\n");
26 writer.setOptions(Poco::XML::XMLWriter::PRETTY_PRINT | Poco::XML::XMLWriter::WRITE_XML_DECLARATION);
27 writer.writeNode(strStream, node);
28 ret = strStream.str();
38 case ResOmitType::ROM_NOT_OMIT :
40 case ResOmitType::ROM_EMPTY_OMIT :
46 case ResOmitType::ROM_NOT_NUM_OMIT :
50 std::stoull(nodeValue, 0, 0);
52 catch(std::exception &exp)
67 Poco::XML::NamedNodeMap *nMap = NULL;
68 Poco::XML::DOMParser parser;
69 Poco::AutoPtr<Poco::XML::Document> pDoc = parser.parseString(inXML);
70 Poco::XML::NodeIterator it(pDoc, Poco::XML::NodeFilter::SHOW_ALL);
71 Poco::XML::Node* rootNode = it.root();
72 Poco::XML::Node* mainNode = rootNode;
73 Poco::XML::Node* dellNode = NULL;
76 dellNode = rootNode->getNodeByPath(XMLPath);
81 std::vector<Poco::XML::Node*> remNodes;
82 std::map<std::string, unsigned int> alreadyNodes;
85 dellNode = dellNode->lastChild();
88 if(dellNode->nodeType() != Poco::XML::Node::TEXT_NODE && dellNode->nodeName() == elemName)
90 nMap = (dellNode->hasAttributes() ? dellNode->attributes() : NULL);
93 Poco::XML::Node *localNode = nMap->getNamedItem(idName);
96 std::map<std::string, unsigned int>::iterator alreadyNodesIt;
100 remNodes.push_back(dellNode);
103 dellNode = dellNode->previousSibling();
106 if((alreadyNodesIt = alreadyNodes.find(localNode->nodeValue())) == alreadyNodes.end())
108 if(delList.find(localNode->nodeValue()) != delList.end())
110 remNodes.push_back(dellNode);
114 alreadyNodes.insert(std::pair<std::string, unsigned int>(localNode->nodeValue(), 1));
119 (*alreadyNodesIt).second++;
120 remNodes.push_back(dellNode);
127 dellNode = dellNode->previousSibling();
130 for(
unsigned int i = 0; i < remNodes.size(); i++)
132 mainNode->removeChild(remNodes[i]);
134 ret = std::move<std::string &&>(
saveXML(rootNode));