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
00059
#include <xercesc/dom/DOM.hpp>
00060
00061
00062 #define null 0
00063
00064 XERCES_CPP_NAMESPACE_USE
00065
00066 XERCES_CPP_NAMESPACE_BEGIN
00067
class XercesDOMParser;
00068 XERCES_CPP_NAMESPACE_END
00069
00070
00071 class DOMTest {
00072
public:
00073 static DOMElement *
testElementNode;
00074 static DOMAttr *
testAttributeNode;
00075 static DOMText *
testTextNode;
00076 static DOMCDATASection *
testCDATASectionNode;
00077 static DOMEntityReference *
testEntityReferenceNode;
00078 static DOMEntity *
testEntityNode;
00079 static DOMProcessingInstruction *
testProcessingInstructionNode;
00080 static DOMComment *
testCommentNode;
00081 static DOMDocument *
testDocumentNode;
00082 static DOMDocumentType *
testDocumentTypeNode;
00083 static DOMDocumentFragment *
testDocumentFragmentNode;
00084 static DOMNotation *
testNotationNode;
00085
00086
00087
DOMTest();
00088
00089
DOMDocument*
createDocument();
00090 DOMDocumentType*
createDocumentType(DOMDocument* doc, XMLCh* name);
00091 DOMEntity*
createEntity(DOMDocument* doc, XMLCh* name);
00092 DOMNotation*
createNotation(DOMDocument* doc, XMLCh* name);
00093
bool docBuilder(DOMDocument* document, XMLCh* name);
00094
00095
void findTestNodes(DOMDocument* document);
00096
void findTestNodes(DOMNode* node);
00097
00098
00099
bool testAttr(DOMDocument* document);
00100
bool testCDATASection(DOMDocument* document);
00101
bool testCharacterData(DOMDocument* document);
00102
bool testChildNodeList(DOMDocument* document);
00103
bool testComment(DOMDocument* document);
00104
bool testDeepNodeList(DOMDocument* document);
00105
00109
bool testDocument(DOMDocument* document);
00110
00111
00115
bool testDocumentFragment(DOMDocument* document);
00116
00117
bool testDocumentType(DOMDocument* document);
00118
bool testDOMerrors(DOMDocument* document);
00119
bool testDOMImplementation(DOMDocument* document);
00120
bool testElement(DOMDocument* document);
00121
bool testEntity(DOMDocument* document);
00122
bool testEntityReference(DOMDocument* document);
00123
00124
00129
bool testNode(DOMDocument* document);
00130
00131
bool testNotation(DOMDocument* document);
00132
bool testPI(DOMDocument* document);
00133
bool testText(DOMDocument* document);
00134
bool treeCompare(DOMNode* node, DOMNode* node2);
00135
00136
bool testBaseURI(XercesDOMParser* parser);
00137
00138 };
00139
00140 class myUserDataHandler :
public DOMUserDataHandler {
00141
private:
00142 DOMOperationType
currentType;
00143 XMLCh*
currentKey;
00144 void*
currentData;
00145 DOMNode*
currentSrc;
00146 DOMNode*
currentDst;
00147
00148
public:
00149 myUserDataHandler() :
00150
currentKey(0),
00151
currentData(0),
00152
currentSrc(0),
00153
currentDst(0) {};
00154
00155 virtual void handle(DOMOperationType operation,
00156
const XMLCh*
const key,
00157
void* data,
00158
const DOMNode* src,
00159
const DOMNode* dst)
00160 {
00161
currentType = operation;
00162
currentKey = (XMLCh*) key;
00163
currentData = data;
00164
currentSrc = (DOMNode*) src;
00165
currentDst = (DOMNode*) dst;
00166 };
00167
00168 DOMOperationType
getCurrentType() {
00169
return currentType;
00170 };
00171 XMLCh*
getCurrentKey()
const {
00172
return currentKey;
00173 };
00174 void*
getCurrentData()
const {
00175
return currentData;
00176 };
00177 DOMNode*
getCurrentSrc()
const {
00178
return currentSrc;
00179 };
00180 DOMNode*
getCurrentDst()
const {
00181
return currentDst;
00182 };
00183
00184 };
00185
00186