From: <dg...@su...> - 2009-01-20 18:16:14
|
Author: savago Date: Tue Jan 20 19:15:10 2009 New Revision: 5212 URL: http://www.opensync.org/changeset/5212 Log: Filling the call to XSLT transform in the remaining converter function. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:13:36 2009 (r5211) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:15:10 2009 (r5212) @@ -80,7 +80,10 @@ *free_input = TRUE; - /* TODO: set OsyncError */ + /* TODO: + * - set OsyncError + * - use a common function to call xslt transform? + */ exit: return result; @@ -88,14 +91,25 @@ static osync_bool conv_contact_to_xslt(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) { - /* - * This function can be used to convert another format to your format. - * Return TRUE if the conversion was successful or return FALSE and set - * the error if something bad has happend. - * + osync_bool result = FALSE; + struct xslt_resources *converter = NULL; + + converter = (struct xslt_resources *)userdata; + if ((result = xslt_transform(converter, input))) + goto exit; + + if (!(*output = strdup(converter->xml_str))) + goto exit; + + *free_input = TRUE; + + /* TODO: + * - set OsyncError + * - use a common function to call xslt transform? */ - return TRUE; +exit: + return result; } |