-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXmlDomDocument.h
executable file
·43 lines (34 loc) · 1.26 KB
/
XmlDomDocument.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef XMLDOMDOCUMENT_H_INCLUDED
#define XMLDOMDOCUMENT_H_INCLUDED
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/sax/HandlerBase.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <string>
using namespace std;
using namespace xercesc;
class XmlDomDocument
{
DOMDocument* m_doc;
public:
XmlDomDocument(const char* xmlfile);
~XmlDomDocument();
string getChildValue(const char* parentTag, int parentIndex,
const char* childTag, int childIndex);
string getChildAttribute(const char* parentTag,
int parentIndex, int childIndex,
const char* childTag,
const char* attributeTag);
int getChildCount(const char* parentTag, int parentIndex,
const char* childTag);
int calculateStart(const char* parentTag, int parentIndex,
const char* childTag);
DOMElement* getElementByTag(const char *tag, int parentIndex);
DOMDocument *getDOMDocument();
private:
XmlDomDocument();
XmlDomDocument(const XmlDomDocument&);
};
#endif // XMLDOMDOCUMENT_H_INCLUDED