00001
00002
00003 #ifndef MIX_DOMPARSER_H_
00004 #define MIX_DOMPARSER_H_
00005
00006 #include "classes.h"
00007 #include "DefaultXMLTraits.h"
00008 #include "SAX_Parser.h"
00009
00010 namespace MiX{
00016 template <class charT,class traitsT>
00017 class DOM_Parser : public SAX_EventHandler<charT,traitsT>{
00018 public:
00019 MiX_Template_Typedef(charT,traitsT);
00020 typedef DOM_Parser<charT,traitsT> this_type;
00021 typedef NodeContainer<charT,traitsT> nodecontainer_type;
00022 typedef typename traitsT::char_traits char_traits;
00023 private:
00025 SAX_Parser<charT,traitsT> parser_;
00027 NodeContainer<charT,traitsT>* current_;
00028 public:
00030 virtual ~DOM_Parser(){ };
00032 virtual void onXMLDeclaration(attrmap_type attr);
00034 virtual void onStart(string_type name,attrmap_type attr);
00036 virtual void onEnd(string_type name);
00038 virtual void onText(string_type text);
00040 virtual void onComment(string_type text);
00041
00043 document_type& parse(const charT* text);
00045 document_type& parse(std::basic_istream<charT, char_traits>& is);
00046
00053 void setIgnoreSpace(bool flag){ parser_.setIgnoreSpace(flag); };
00054 };
00055 }
00056
00057 #ifndef MIX_DOMPARSER_CPP_
00058 #include "DOM_Parser.cpp"
00059 #endif
00060
00061 #endif