xmlformat_compare not working for sub-fields

View: New views
1 Messages — Rating Filter:   Alert me  

xmlformat_compare not working for sub-fields

by Henrik /KaarPoSoft :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

xmlformat_compare has a nice way of comparing OSyncXMLFields; adding and
subtracting "points" to see how well two OSyncXMLFormats match.
However, this does *not* extend to sub-fields.

If we have
  <Name>
    <LastName>Doe</LastName>
    <FirstName>John</FirstName>
  </Name>
and compare to
  <Name>
    <LastName>Doe</LastName>
    <FirstName>John</FirstName>
    <Prefix>Mr.</Prefix>
  </Name>
the two fields will not match, resulting in a -90 points penalty.

Even worse, if we have
  <Name>
    <LastName>Doe</LastName>
    <FirstName>John</FirstName>
  </Name>
and compare this to how file-sync currently reports vcards to xml:
  <Name>
    <LastName>Doe</LastName>
    <FirstName>John</FirstName>
    <Additional></Additional>
    <Prefix></Prefix>
    <Suffix></Suffix>
  </Name>
the two fields will not match either
(we get "Run out of list2 elements. Different.")

Does anyone have a good idea as to how to resolve this issue?

/Henrik

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel