diff --git a/Makefile.header b/Makefile.header index 53cc18c9..c2846c5b 100644 --- a/Makefile.header +++ b/Makefile.header @@ -1,7 +1,7 @@ #################################### # ARABICA CONFIG # edit for your parser choice - may include more than one USE_* -PARSER_CONFIG = -DUSE_EXPAT +PARSER_CONFIG = -DUSE_EXPAT -DARABICA_NO_WCHAR_T #PARSER_CONFIG = -DUSE_EXPAT -DUSE_LIBXML2 -DUSE_XERCES -DUSE_GARDEN #################################### @@ -42,8 +42,8 @@ DYNAMIC_LIBS = -lexpat -lstdc++ # link flag to create a shared library LINK_SHARED = -shared -EXESUFFIX = -LIBSUFFIX = .so +EXESUFFIX = .exe +LIBSUFFIX = .dll diff --git a/XPath/impl/xpath_object.hpp b/XPath/impl/xpath_object.hpp index cfeca589..dfed9186 100644 --- a/XPath/impl/xpath_object.hpp +++ b/XPath/impl/xpath_object.hpp @@ -329,25 +329,21 @@ string_type nodeStringValue(const DOM::Node& node) //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// + +namespace impl { +template struct value_of_node { + RT operator()(const DOM::Node& node) { return nodeStringValue(node); } +}; +template struct value_of_node { + double operator()(const DOM::Node& node) { return nodeNumberValue(node); } +}; +} // namespace impl + template class compareNodeWith { typedef typename Op::first_argument_type T; - // this is all far more complicated that I'd hoped. I wanted a template function, specialised on - // string_type and double. Instead I have finished up using a class with an operator() which is partially - // specialised on string_type and double with an unused template parameter. - // ho hum - see http://lists.debian.org/debian-gcc/2004/09/msg00015.html or - // google for "explicit specialization in non-namespace scope" - template struct value_of_node { - RT operator()(const DOM::Node& node); - }; - template struct value_of_node { - string_type operator()(const DOM::Node& node) { return nodeStringValue(node); } - }; - template struct value_of_node { - double operator()(const DOM::Node& node) { return nodeNumberValue(node); } - }; public: compareNodeWith(const T& value) : value_(value) { } @@ -355,7 +351,7 @@ public: bool operator()(const DOM::Node& node) { - value_of_node nv; + impl::value_of_node nv; return Op()(nv(node), value_); } // operator()