1 #ifndef ots_XmlDocument_h
2 #define ots_XmlDocument_h
6 #include <xercesc/dom/DOMElement.hpp>
7 #include <xercesc/parsers/XercesDOMParser.hpp>
19 xercesc::DOMElement* addTextElementToParent(std::string childName,
20 std::string childText,
21 xercesc::DOMElement* parent);
22 xercesc::DOMElement* addTextElementToParent(std::string childName,
23 std::string childText,
24 std::string parentName,
25 unsigned int parentIndex = 0);
27 void saveXmlDocument(std::string filePath);
28 void recursiveRemoveChild(
29 xercesc::DOMElement* childEl,
30 xercesc::DOMElement* parentEl);
33 bool loadXmlDocument(std::string filePath);
35 void outputXmlDocument(std::ostringstream* out,
bool dispStdOut =
false);
38 void copyDocument(
const xercesc::DOMDocument* toCopy, xercesc::DOMDocument* copy);
39 void recursiveElementCopy(
const xercesc::DOMElement* toCopy,
40 xercesc::DOMElement* copy);
41 void initDocument(
void);
42 void initPlatform(
void);
43 void terminatePlatform(
void);
44 void recursiveOutputXmlDocument(xercesc::DOMElement* currEl,
45 std::ostringstream* out,
46 bool dispStdOut =
false,
47 std::string tabStr =
"");
57 std::string escapeString(std::string inString,
bool allowWhiteSpace =
false);
59 xercesc::DOMImplementation* theImplementation_;
60 xercesc::DOMDocument* theDocument_;
61 xercesc::DOMElement* rootElement_;
63 const std::string rootTagName_;
68 #endif // ots_XmlDocument_h