00001 /* 00002 * StateInfo.h 00003 * 00004 * Created on: 25.07.2009 00005 * Author: marc 00006 */ 00007 00008 #ifndef SEMAINE_DATATYPES_XPATHINFOMAPPER_H 00009 #define SEMAINE_DATATYPES_XPATHINFOMAPPER_H 00010 00011 #include <string> 00012 #include <map> 00013 00014 #include <xercesc/dom/DOM.hpp> 00015 00016 #include <semaine/util/XMLTool.h> 00017 00018 #include <semaine/cms/CMSLogger.h> 00019 #include <semaine/cms/exceptions/SystemConfigurationException.h> 00020 #include <semaine/cms/exceptions/MessageFormatException.h> 00021 00022 #include <semaine/datatypes/stateinfo/NamespaceContext.h> 00023 #include <xqilla/xqilla-dom3.hpp> 00024 00025 namespace semaine { 00026 00027 namespace datatypes { 00028 00029 namespace stateinfo { 00030 00031 00032 class XPathInfoMapper { 00033 public: 00034 XPathInfoMapper(const std::map<std::string, std::string> & prefixes2NamespaceURIs, 00035 const std::map<std::string, std::string> & names2XpathExpressions); 00036 virtual ~XPathInfoMapper() {} 00037 const NamespaceContext * getNamespaceContext() 00038 { 00039 return &namespaceContext; 00040 } 00041 00048 const std::string * getExpression(const std::string & shortName) 00049 { 00050 std::map<std::string, std::string>::const_iterator it = names2exprString.find(shortName); 00051 if (it != names2exprString.end()) return &(it->second); 00052 return NULL; 00053 } 00054 00055 const std::map<std::string, std::string> & getExpressionMap() 00056 { 00057 return names2exprString; 00058 } 00059 00060 private: 00061 NamespaceContext namespaceContext; 00062 const std::map<std::string, std::string> names2exprString; 00063 00064 }; 00065 00066 00067 00068 00069 } 00070 00071 } 00072 00073 } 00074 00075 #endif /* SEMAINE_DATATYPES_XPATHINFOMAPPER_H */