00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BAKERY_DOCUMENT_XML_H
00020 #define BAKERY_DOCUMENT_XML_H
00021
00022 #include "bakery/Document/Document.h"
00023 #include <libxml++/libxml++.h>
00024
00025
00026
00027
00028
00029
00030
00031 namespace Bakery
00032 {
00033
00034 class Document_XML : public Bakery::Document
00035 {
00036 public:
00037 Document_XML();
00038 virtual ~Document_XML();
00039
00040
00041 virtual bool load_after();
00042 virtual bool save_before();
00043
00044 virtual void set_dtd_name(const std::string& strVal);
00045 virtual std::string get_dtd_name() const;
00046
00047 virtual void set_dtd_root_node_name(const Glib::ustring& strVal);
00048 virtual Glib::ustring get_dtd_root_node_name() const;
00049
00050 virtual bool set_xml(const Glib::ustring& strXML);
00051 virtual Glib::ustring get_xml();
00052
00053 protected:
00054 static Glib::ustring get_node_attribute_value(const xmlpp::Element* node, const Glib::ustring& strAttributeName);
00055 static void set_node_attribute_value(xmlpp::Element* node, const Glib::ustring& strAttributeName, const Glib::ustring& strValue);
00056 virtual xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ustring& strName) const;
00057 virtual xmlpp::Element* get_node_child_named_with_add(xmlpp::Element* node, const Glib::ustring& strName);
00058
00059 virtual const xmlpp::Element* get_node_document() const;
00060 virtual xmlpp::Element* get_node_document();
00061
00062
00063 virtual void Util_DOM_Write(Glib::ustring& refstrXML);
00064
00065 typedef Bakery::Document type_base;
00066
00067
00068 xmlpp::DomParser m_DOM_Parser;
00069 xmlpp::Document* m_pDOM_Document;
00070
00071 std::string m_strDTD_Name;
00072 Glib::ustring m_strRootNodeName;
00073 };
00074
00075 }
00076
00077 #endif // BAKERY_DOCUMENT_XML_H