FILE(GLOB OMA_SRCS *.c)
+pkg_check_modules(LIBXML libxml-2.0 REQUIRED)
+if(PKG_CONFIG_FOUND AND ${LIBXML_VERSION} VERSION_GREATER 2.11.0)
+ message(STATUS "libxml2.0 version is greater than 2.11.0. ${LIBXML_VERSION}")
+else()
+ message(STATUS "libxml2.0 version ${LIBXML_VERSION}")
+ ADD_DEFINITIONS("-D_USE_USER_PARSE_FILE")
+endif()
+
+
ADD_DEFINITIONS("-DDEBUG_USING_DLOG")
ADD_LIBRARY(${LIB_OMA_PARSER} OBJECT ${OMA_SRCS})
goto ERR;
}
+#ifdef _USE_USER_PARSE_FILE
if (xmlSAXUserParseFile(sHandlerPtr, app_data, dd_file_path) < 0) {
OP_LOGD("Error : return value less than zero");
*error_code = app_data->parseError;
b_ret = OP_FALSE;
goto ERR;
}
+#else
+ xmlParserCtxtPtr ctxt = xmlNewSAXParserCtxt(sHandlerPtr, app_data);
+ if (ctxt == NULL) {
+ OP_LOGE("xmlNewSAXParserCtxt() is failed.");
+ b_ret = OP_FALSE;
+ goto ERR;
+ }
+
+ xmlDocPtr doc = xmlCtxtReadFile(ctxt, dd_file_path, NULL, XML_PARSE_COMPACT | XML_PARSE_BIG_LINES);
+ if (OP_RESULT_OK != app_data->parseError) {
+ *error_code = app_data->parseError;
+ b_ret = OP_FALSE;
+ xmlFreeDoc(doc);
+ goto ERR;
+ }
+ xmlFreeDoc(doc);
+#endif
if (OP_FALSE == (b_ret = op_check_mandatory_tags(app_data))) {
OP_LOGE("Parse error happened. Mandatory Element Missing");