From: Adenilson C. <cav...@gm...> - 2008-09-25 19:03:44
|
Friends The problem: when doing a sync, new contacts reported by google data plugin generate this error: ######################################################################################### Entity: line 1: parser error : Start tag expected, '<' not found ERROR: Could not parse XML. ######################################################################################### By grep'ing the source code, I identified the source of this error message in opensync_xmlformat.c:osync_xmlformat_parse. Initially, I thought that when I create an OSyncXMLFormat object with 'osync_xmlformat_parse' was triggering this error. But later inspection confirmed that it is not the case. Besides, the XML text used to create this object validates using xmllint and xmlformat-contact schema. Reading the traces, I uncovered that this error is happing when opensync does the conversion from xmlformat-contact-doc to xmlformat-contact, like bellow: ######################################################################################### [1222367349.920297] Setting converter_path of 2_contact to 0xb0219170 [1222367349.920323] >>>>>>> osync_format_env_convert(0x8064870, 0xb0219170, 0x81680d0, 0xb6dbc1a8) [1222367349.920350] >>>>>>> osync_converter_invoke(0x8066260, 0x81680d0, (NULL), 0xb6dbc1a8) [1222367349.920602] Converter of type 1, from 0x8066d28(xmlformat-contact-doc) to 0x8064bf8(xmlformat-contact) [1222367349.920632] >>>>>>> osync_xmlformat_parse(0x817b0b0, 24, 0xb6dbc1a8) [1222367349.920714] ERROR: Could not parse XML. [1222367349.920744] <--- ERROR --- osync_xmlformat_parse: Could not parse XML. [1222367349.920771] <--- ERROR --- osync_converter_invoke: Could not parse XML. [1222367349.920797] <--- ERROR --- osync_format_env_convert: Could not parse XML. ######################################################################################### The complete log is available here: http://pastebin.com/m301cd82b And the source code of gdata plugin is available here: http://repo.or.cz/w/gdataplugin.git I based the code of creating the change in file-sync plugin, with the logic of: - create an OSyncXMLFormat object from raw XML representation of google contact (converted to osync xml format); - create an OSyncData object from the first object; - create an OSyncChange object from the later and report the change. I'm probably making misuse of the opensync API, but I'm out of clues. Anyone have an idea of what is missing here? Best regards Adenilson |