include/DomParserCommon.H

00001 /* ${copyright}$ */
00002 /* $Id: DomParserCommon.H 542 2006-03-06 22:02:09Z eduardo $ */
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 
00018 #include "libepp_nicbr.H"
00019 
00020 using std::string;
00021 using std::map;
00022 using std::less;
00023 using std::auto_ptr;
00024 
00025 XERCES_CPP_NAMESPACE_USE
00026 
00027 LIBEPP_NICBR_NS_BEGIN
00028 
00030 class DomParserCommon
00031 {
00032 public:
00034   DomParserCommon();
00035 
00037   ~DomParserCommon();
00038 
00040 
00043   void enable_validation(const string& schemas_dir = SCHEMASDIR);
00044 
00046   void disable_validation();
00047 
00049 
00053   static string str_transcode(const XMLCh *const to_transcode);
00054 
00055 protected:
00057 
00061   DOMNode *parse(const string &xml_payload);
00062 
00064 
00068   void fill_postal_info(DOMNode *n,
00069                         struct CommonData::PostalInfo *postal_info);
00070 
00072 
00076   map< string, string, less<string> > get_children_simple(DOMNode *n);
00077 
00079 
00083   map< string, string, less<string> > get_attributes(DOMNode *n);
00084 
00086   DOMBuilder *_builder;
00087 
00089   DomErrorHandler _error_handler;
00090 };
00091 
00092 LIBEPP_NICBR_NS_END
00093 #endif //__DOMPARSERCOMMON_H__

Generated on Wed Mar 22 14:18:27 2006 for libepp_nicbr by  doxygen 1.4.6