00001
00002
00003 #ifndef MIX_DOCUMENT_H_
00004 #define MIX_DOCUMENT_H_
00005
00006 #include "classes.h"
00007 #include "misc.h"
00008 #include "XMLString.h"
00009
00010 namespace MiX{
00016 template <class Char,class Traits,class XMLTraits>
00017 class Document : public NodeContainer<Char,Traits,XMLTraits>{
00018 public:
00019 MiX_Template_Typedef(Char,Traits,XMLTraits);
00020 typedef Document<Char,Traits,XMLTraits> this_type;
00021 typedef NodeContainer<Char,Traits,XMLTraits> nodecontainer_type;
00022 protected:
00029 Document() { };
00035 Document(const Document<Char,Traits,XMLTraits>& src){ };
00036 public:
00038 virtual ~Document()throw() { };
00040 virtual NodeType getType() const{ return Node_Document; };
00046 static NodeType type(){ return Node_Document; } ;
00048 Element<Char,Traits,XMLTraits>& getRoot()const;
00055 virtual string_type toString(bool is_indent=false,int indent_off=0)const;
00062 attribute_type& operator[](const string_type& name){
00063 return getAttribute(name);
00064 }
00073 static this_type& create(const string_type& rootname);
00074
00075 friend class DOM_Parser<Char,Traits,XMLTraits>;
00076 };
00077 }
00078
00079 #ifndef MIX_DOCUMENT_CPP_
00080 #include "Document.cpp"
00081 #endif
00082
00083 #endif