00001
00002
00007 #ifndef __DOMPARSERCOMMON_H__
00008 #define __DOMPARSERCOMMON_H__
00009
00010 #include <string>
00011 #include <map>
00012 #include <memory>
00013
00014 #include <xercesc/dom/DOM.hpp>
00015 #include "DomErrorHandler.H"
00016 #include "CommonData.H"
00017 #include "DSInfo.H"
00018
00019 #include "libepp_nicbr.H"
00020
00021 using std::string;
00022 using std::map;
00023 using std::less;
00024 using std::auto_ptr;
00025
00026 XERCES_CPP_NAMESPACE_USE
00027
00028 LIBEPP_NICBR_NS_BEGIN
00029
00031 class DomParserCommon
00032 {
00033 public:
00035 DomParserCommon();
00036
00038 ~DomParserCommon();
00039
00041
00044 void enable_validation(const string& schemas_dir = SCHEMASDIR);
00045
00047 void disable_validation();
00048
00050
00054 static string str_transcode(const XMLCh *const to_transcode);
00055
00056 protected:
00058
00062 DOMNode *parse(const string &xml_payload);
00063
00065
00069 void fill_postal_info(DOMNode *n, PostalInfo *postal_info);
00070
00072
00076 void fill_ds_info(DOMNode *n, DSInfo *ds_info);
00077
00078 #if USE_IP_MANAGEMENT
00080
00083 IpRange fill_ipRange(DOMNode *n);
00084
00086
00089 ReverseDns fill_reverseDns(DOMNode *n);
00090 #endif // USE_IP_MANAGEMENT
00091
00092 #if USE_BR_ORG
00094
00097 IpRange fill_brorg_ipRange(DOMNode *n);
00098 #endif // USE_BR_ORG
00099
00101
00105 map< string, string, less<string> > get_children_simple(DOMNode *n);
00106
00108
00112 map< string, string, less<string> > get_attributes(DOMNode *n);
00113
00115 DOMBuilder *_builder;
00116
00118 DomErrorHandler _error_handler;
00119 };
00120
00121 LIBEPP_NICBR_NS_END
00122 #endif //__DOMPARSERCOMMON_H__