hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
main.cpp
Go to the documentation of this file.
1 
13 #include <Poco/DOM/DOMParser.h>
14 #include <Poco/DOM/DOMWriter.h>
15 #include <Poco/DOM/Document.h>
16 #include <Poco/DOM/NodeIterator.h>
17 #include <Poco/DOM/NodeFilter.h>
18 #include <Poco/DOM/AutoPtr.h>
19 #include <Poco/DOM/NamedNodeMap.h>
20 #include <Poco/XML/XMLException.h>
21 #include <Poco/XML/XMLWriter.h>
22 #include <Poco/SAX/InputSource.h>
23 #include <Poco/SharedPtr.h>
24 
25 #include <fstream>
26 #include <iostream>
27 
28 #include "XMLCleaner.hpp"
29 
30 int main(int argc, char** argv)
31 {
32  XMLCleaner xmlCleaner("sphinx:docset", "sphinx:document", "id");
33  std::string xmlString;
34  std::ifstream in("./branch_0001.xml");
35  in.seekg(0, std::ios::end);
36  xmlString.resize(in.tellg());
37  in.seekg(0, std::ios::beg);
38  in.read(&xmlString[0], xmlString.size());
39  in.close();
40  std::set<unsigned long long> delList;
41  delList.insert(14llu);
42  delList.insert(24llu);
43  try
44  {
45  std::cout << xmlCleaner.process(xmlString, delList) << std::endl;
46  }
47  catch(Poco::XML::XMLException &excp)
48  {
49  std::cout << ">>> XML EXCPT - " << excp.name() << " MSG = " << excp.message() << std::endl;
50  }
51  catch(Poco::Exception &excp)
52  {
53  }
54  return EXIT_SUCCESS;
55 }