Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

diff'ing by a "key" element

Help
Lou
2009-01-27
2013-03-03
  • Lou
    Lou
    2009-01-27

    OK, this is a long shot, but does anyone have any "tricks" to do the following:

    Given the XML:

    <row>
    <keycell>ABC</keycell><othercell>blah</othercell>
    </row>

    Can I get the following:

    1.  When the "keycell" is different, return that the entire "row" is different.
    2.  When any other cells in the row are different (othercell for instance), return that only the cell is different.

    Thanks.

     
    • Stefan Bodewig
      Stefan Bodewig
      2009-01-30

      You may get it working using a custom ElementQualifier along the lines:

      * If the element you are looking at is a "row" then only compare it to rows with the same content in the first keycell child.

      * otherwise compare the elements if they have the same name.

      I don't see any solution that wouldn't require custom code.

       
    • Lou
      Lou
      2009-02-03

      OK, I just wanted to make sure there wasn't a diff.checkForRowDiffsOnlyAndReportItBack() method.  :)