Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00060 #include <xercesc/dom/DOM.hpp>
00061
00062
00063 #define null 0
00064
00065 XERCES_CPP_NAMESPACE_USE
00066
00067 XERCES_CPP_NAMESPACE_BEGIN
00068 class XercesDOMParser;
00069 XERCES_CPP_NAMESPACE_END
00070
00071
00072 class DOMTest {
00073 public:
00074 static DOMElement *testElementNode;
00075 static DOMAttr *testAttributeNode;
00076 static DOMText *testTextNode;
00077 static DOMCDATASection *testCDATASectionNode;
00078 static DOMEntityReference *testEntityReferenceNode;
00079 static DOMEntity *testEntityNode;
00080 static DOMProcessingInstruction *testProcessingInstructionNode;
00081 static DOMComment *testCommentNode;
00082 static DOMDocument *testDocumentNode;
00083 static DOMDocumentType *testDocumentTypeNode;
00084 static DOMDocumentFragment *testDocumentFragmentNode;
00085 static DOMNotation *testNotationNode;
00086
00087
00088 DOMTest();
00089
00090 DOMDocument* createDocument();
00091 DOMDocumentType* createDocumentType(DOMDocument* doc, XMLCh* name);
00092 DOMEntity* createEntity(DOMDocument* doc, XMLCh* name);
00093 DOMNotation* createNotation(DOMDocument* doc, XMLCh* name);
00094 bool docBuilder(DOMDocument* document, XMLCh* name);
00095
00096 void findTestNodes(DOMDocument* document);
00097 void findTestNodes(DOMNode* node);
00098
00099
00100 bool testAttr(DOMDocument* document);
00101 bool testCDATASection(DOMDocument* document);
00102 bool testCharacterData(DOMDocument* document);
00103 bool testChildNodeList(DOMDocument* document);
00104 bool testComment(DOMDocument* document);
00105 bool testDeepNodeList(DOMDocument* document);
00106
00110 bool testDocument(DOMDocument* document);
00111
00112
00116 bool testDocumentFragment(DOMDocument* document);
00117
00118 bool testDocumentType(DOMDocument* document);
00119 bool testDOMerrors(DOMDocument* document);
00120 bool testDOMImplementation(DOMDocument* document);
00121 bool testElement(DOMDocument* document);
00122 bool testEntity(DOMDocument* document);
00123 bool testEntityReference(DOMDocument* document);
00124
00125
00130 bool testNode(DOMDocument* document);
00131
00132 bool testNotation(DOMDocument* document);
00133 bool testPI(DOMDocument* document);
00134 bool testText(DOMDocument* document);
00135 bool treeCompare(DOMNode* node, DOMNode* node2);
00136
00137 bool testBaseURI(XercesDOMParser* parser);
00138
00139 };
00140
00141 class myUserDataHandler : public DOMUserDataHandler {
00142 private:
00143 DOMOperationType currentType;
00144 XMLCh* currentKey;
00145 void* currentData;
00146 DOMNode* currentSrc;
00147 DOMNode* currentDst;
00148
00149 public:
00150 myUserDataHandler() :
00151 currentKey(0),
00152 currentData(0),
00153 currentSrc(0),
00154 currentDst(0) {};
00155
00156 virtual void handle(DOMOperationType operation,
00157 const XMLCh* const key,
00158 void* data,
00159 const DOMNode* src,
00160 const DOMNode* dst)
00161 {
00162 currentType = operation;
00163 currentKey = (XMLCh*) key;
00164 currentData = data;
00165 currentSrc = (DOMNode*) src;
00166 currentDst = (DOMNode*) dst;
00167 };
00168
00169 DOMOperationType getCurrentType() {
00170 return currentType;
00171 };
00172 XMLCh* getCurrentKey() const {
00173 return currentKey;
00174 };
00175 void* getCurrentData() const {
00176 return currentData;
00177 };
00178 DOMNode* getCurrentSrc() const {
00179 return currentSrc;
00180 };
00181 DOMNode* getCurrentDst() const {
00182 return currentDst;
00183 };
00184
00185 };
00186
00187