Announcement

Collapse
No announcement yet.

Attribute alignment when comparing XML tags with many attributes

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Attribute alignment when comparing XML tags with many attributes

    I am using a modified version of the XML Tidied Format. There are a lot of attributes I want to ignore (this could be a modified_date or modified_by which changes whenever somebody changes the content of a tag. The modified_by and modifyed_data bubbles all the way to the top element in our documents.
    When using the XML Tidied format - Beyond Compare nicely shows which lines differ in two files. It also (very often) align lines in the XML file correctly.
    My question: When I have multiple attributes on a XML tag. Some of them I want to ignore - how do I make sure alignment is done correctly.
    See the following screen-dump:

    Notice that NO="1" don't align in the two lines. It should be noted that all attributes next to NO are ignored.
    Can BC be set op to align in a specific way? I want MODIFIED_BY to always be aligned with MODIFIED_BY etc?

    (In the screenshot I have shown my Rules for XML Tidied)
    Attached Files

  • #2
    Hello,

    The issue here is that the tidy restructures the text, but line by line we still compare the characters in the line as plain text. The Text Compare aligns character by character as best it can using an algorithm that approaches the entire line. Note the very long numeric string (P_Z="" on the left, and part of Modified on the Right) that is aligned; this will then push other text to the left and right of this matching section. The NO="1" text in the left file is before this section, and is to the right in the right file. It appears the attributes are different Left <-> Right but contain some of the same values? The Tidy would sort the attributes first, and then align; given the length of the value text it will often be matched upon.

    Is it intended to have different attributes with the same value? Should this be aligned? Should the right side be reconciled to have matching attributes?
    Aaron P Scooter Software

    Comment


    • #3
      Originally posted by Aaron View Post
      It appears the attributes are different Left <-> Right but contain some of the same values?
      Yes that is correct. Some attributes exist in the left file and not in the right file. The attributes that don't exist in both are supposed to be ignored (P_Z="..", P_CHI2="...",etc). And some attributes that DO exist in both (MODIFIED and MODIFIED_BY) I want to ignore because they (almost) always differ. What is left is eg: NO="1", ESTIMABLE="YES" on left and ESTIMABLE="NO" on right. In this case I want Beyond Compare to match NO="1" in both files since they are the same - BUT I want Beyond Compare to tell me that ESTIBALE is different in the two files <- this is the information I am looking for...

      Originally posted by Aaron View Post
      The Tidy would sort the attributes first, and then align; given the length of the value text it will often be matched upon.
      It is super that Tidy sorts the attributes - this makes it easier to compare...

      Originally posted by Aaron View Post
      Is it intended to have different attributes with the same value?
      It is not intentional to have different attributes with same values - I don't think that is the case in the screenshot.

      Originally posted by Aaron View Post
      Should this be aligned?
      I would expect Beyond Compare to align same attributes underneath each other in the two lines at the bottom of the screen. I would NOT expect Beyond Compare to align something in the bottom line with something above that is to be ignored...? - This is exactly what happens with:
      ESTIMABLE="YES" I2="50...314" I2_Q="0.0"
      when it is compared to:
      ESTIMABLE="NO"
      In this case the last quote from I2_Q="0.0" is matched with the last quote of ESTIMABLE="NO" even though I2="..." and I2_Q="..." both should be ignored according to the rules in the top of the screenshot?!?

      Originally posted by Aaron View Post
      Should the right side be reconciled to have matching attributes?
      I am not sure what this means - but if it means aligning the same attributes then yes!

      Comment


      • #4
        Would it be possible to get a pair of sample files and your current BCSupport.zip (Help menu -> Support; Export)? The current dilemma is that the value of the text is aligning based on the entire text of the line, not just the attribute names.

        When you email us at support@scootersoftware.com, please include a link back to this forum thread for our reference.
        Aaron P Scooter Software

        Comment


        • #5
          Sorry for the long delay
          I have sent a mail to support with some sample files - hope it is of use to you

          Comment


          • #6
            Hello,

            XML Tidied can sort and tidy nodes, but maintains the structure. If an attribute (MODIFIED or MODIFIED_BY) is in a PERSON node on one side but the CREATOR node on the other, and both nodes exist on both sides, then this moved data and would be a difference. This is at least once difference I found in the example that might be confusing, but in your original files appears to be a real difference that shouldn't be sorted/moved from one node into another.
            Aaron P Scooter Software

            Comment

            Working...
            X