|
From: Henrik /K. <he...@ka...> - 2009-10-22 08:47:36
|
Henrik /KaarPoSoft wrote: > Daniel Gollub wrote: >> On Tuesday 20 October 2009 07:02:17 pm Henrik /KaarPoSoft wrote: >> >>> Some elements in an xml format can have attributes, such as: >>> <Address Location="Home"> >>> Is there any way to define which such capabilities a plugin supports? >>> >>> One plugin may support only one address without specifying location, >>> another plugin may support only Home, >>> and a third may support Home and Work, >>> etc. >> In theory: yes. >> >> Unfortuantely the xmlformat-merger and -demerger function is not yet >> handling attributes. It's just handles the fields. >> >> But you can already define capabilities that you only support a limit >> type of attributes - e.g. as value enumeration (valenum). [SNIP] >> Still, we would need to implement merger and demerger code to handle >> the XML attributes in the xmlformat plugin ... Here is a "real-life" example: On the first slow sync between a syncml phone and mozilla-sync, the phone sends a VCARD with the line TEL;PREF;WORK;VOICE:11111111 mozilla-sync does not have PREF nor VOICE, so it stores this phone number as WORK. On the second slow sync, we then ge a conflict. The above VCARD is translated to xml as: <Telephone Preferred="true" Location="Work" Type="Voice"> <Content>11111111</Content> </Telephone> Whereas the mozilla-sync entry is translated to <Telephone Location="Work"> <Content>11111111</Content> </Telephone> The two cards compare as SIMILAR (not SAME), because xmlformat_compare sees that the attribute count on <Telephone> is different. So, if I understand correctly, what I need to do to get this to work is two things: 1) Patch merger and demerger code in xmlformat plugin 2) Add this to my capabilities: <Cap> <Name>Telephone</Name> <Parameter> <Name>Location</Name> <ValEnum>Work</ValEnum> </Parameter> </Cap> It that correct? /Henrik |