00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __BxDomParser__
00019 #define __BxDomParser__
00020
00021 #include <xercesc/util/PlatformUtils.hpp>
00022 #include <xercesc/util/XMLString.hpp>
00023 #include <xercesc/dom/DOM.hpp>
00024
00025 #include "BxObject.h"
00026 #include "BxDomNodeList.h"
00027 #include "BxDomAttributeList.h"
00028 #include "BxDomErrorHandler.h"
00029
00030 XERCES_CPP_NAMESPACE_USE
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class DECLSPEC BxDomParser : public BxObject
00041 {
00042 BxDomErrorHandler * errorHandler_;
00043 bool errorOccurred_;
00044
00045 DOMBuilder * parser_;
00046 DOMDocument * doc_;
00047 DOMNode * rootNode_;
00048 DOMNode * defNode_;
00049
00050 int binxVersion_;
00051
00052 public:
00053 BxDomParser();
00054 BxDomParser(const char * xmlFilename);
00055 virtual ~BxDomParser();
00056
00057 bool parse(const char * xmlFilename);
00058 bool hasErrors() const { return errorOccurred_; }
00059 bool isBinxFile() const;
00060 BxDomNodeList * getElements() { return new BxDomNodeList(rootNode_->getChildNodes()); }
00061 BxDomNodeList * getTypeDefinitions();
00062 BxDomNodeList * getTypeDefinitions(const char * tag);
00063 BxDomAttributeList * getDatasetAttributes();
00064 BxDomNodeList * getFiles();
00065
00066 protected:
00067 virtual void init();
00068 virtual void terminate();
00069 };
00070
00071
00072 #endif