1 #ifndef ots_XmlDocument_h
2 #define ots_XmlDocument_h
4 #include <xercesc/parsers/XercesDOMParser.hpp>
5 #include <xercesc/dom/DOMElement.hpp>
21 xercesc::DOMElement* addTextElementToParent (std::string childName, std::string childText, xercesc::DOMElement* parent);
22 xercesc::DOMElement* addTextElementToParent (std::string childName, std::string childText, std::string parentName,
unsigned int parentIndex=0);
24 void saveXmlDocument (std::string filePath);
25 void recursiveRemoveChild (xercesc::DOMElement *childEl,xercesc::DOMElement *parentEl);
28 bool loadXmlDocument (std::string filePath);
30 void outputXmlDocument (std::ostringstream *out,
bool dispStdOut=
false);
33 void copyDocument (
const xercesc::DOMDocument* toCopy, xercesc::DOMDocument* copy);
34 void recursiveElementCopy (
const xercesc::DOMElement* toCopy, xercesc::DOMElement* copy);
35 void initDocument (
void);
36 void initPlatform (
void);
37 void terminatePlatform (
void);
38 void recursiveOutputXmlDocument (xercesc::DOMElement *currEl, std::ostringstream *out,
bool dispStdOut=
false, std::string tabStr=
"");
44 std::string escapeString (std::string inString,
bool allowWhiteSpace=
false);
46 xercesc::DOMImplementation* theImplementation_;
47 xercesc::DOMDocument* theDocument_;
48 xercesc::DOMElement* rootElement_;
50 const std::string rootTagName_;
55 #endif //ots_XmlDocument_h