14 #include <Poco/SAX/SAXException.h>
19 std::string
XMLpath =
"sphinx:docset/sphinx:schema";
26 Poco::XML::DOMParser parser;
27 Poco::AutoPtr<Poco::XML::Document> pDoc = parser.parseString(
saveXMLTest_Data);
28 Poco::XML::NodeIterator it(pDoc, Poco::XML::NodeFilter::SHOW_ALL);
29 Poco::XML::Node* rootNode = it.root();
32 CPPUNIT_ASSERT(!ret.empty());
34 CPPUNIT_ASSERT(ret.find(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>") != ret.npos || ret.find(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>") != ret.npos);
35 CPPUNIT_ASSERT(ret.find(
"<sphinx:docset xmlns:sphinx=\"http://sphinxsearch.com\">") != ret.npos);
36 CPPUNIT_ASSERT(ret.find(
"<sphinx:document id=\"24\">") != ret.npos);
37 CPPUNIT_ASSERT(ret.find(
"<h><![CDATA[[time element, as specified in ISO 8601. Year: YYYY (eg 1997) Year and month: YYYY-MM (eg 1997-07)]]></h>") != ret.npos);
38 CPPUNIT_ASSERT(ret.find(
"</sphinx:docset>") != ret.npos);
40 CPPUNIT_ASSERT(ret.find(
"<empty tag>") == ret.npos);
43 CPPUNIT_ASSERT(ret.empty());
49 std::set<unsigned long long> delList;
53 CPPUNIT_ASSERT(!ret.empty());
54 CPPUNIT_ASSERT(ret.find(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>") != ret.npos || ret.find(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>") != ret.npos);
55 CPPUNIT_ASSERT(ret.find(
"<sphinx:docset xmlns:sphinx=\"http://sphinxsearch.com\">") != ret.npos);
56 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0022_1</ext_f4>") != ret.npos);
57 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0023_2</ext_f4>") != ret.npos);
58 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0024_1</ext_f4>") != ret.npos);
59 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0023_1</ext_f4>") == ret.npos);
65 CPPUNIT_ASSERT(!ret.empty());
66 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0022_1</ext_f4>") == ret.npos);
67 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0023_2</ext_f4>") != ret.npos);
68 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0024_1</ext_f4>") != ret.npos);
69 CPPUNIT_ASSERT(ret.find(
"<ext_f4>0023_1</ext_f4>") == ret.npos);
91 CppUnit::TestSuite *suiteOfTests =
new CppUnit::TestSuite(
"XMLCleanerTest");