From: <dg...@su...> - 2009-01-19 21:21:50
|
Author: savago Date: Mon Jan 19 22:20:49 2009 New Revision: 5200 URL: http://www.opensync.org/changeset/5200 Log: Adding code to create a XSLT context and load the transformation stylesheet. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:15:35 2009 (r5199) +++ format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:20:49 2009 (r5200) @@ -177,14 +177,17 @@ void *initialize(const char* config, OSyncError **error) { - /* - * Here you can create converter specific data. - * If you return the converter specific data, it is passed - * to the conversion and detector function as void *userdata - */ -/* format_data *userdata = osync_try_malloc0(sizeof(format_data), error); - return (void*)userdata; -*/ + struct xslt_resources *converter = xslt_new(); + int result = 0; + if (!converter) + osync_error_set(error, OSYNC_ERROR_GENERIC, + "Unable create xslt converter context."); + if ((result = xslt_initialize(converter, config))) + osync_error_set(error, OSYNC_ERROR_GENERIC, + "Unable load xslt stylesheet."); + + return converter; + } void finalize(void *userdata) |