Ignore XML attribute order when comparing XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kristiaan
    New User
    • Feb 2018
    • 2

    Ignore XML attribute order when comparing XML

    Hello all,

    First of all great work with BC4, I love it.
    I am having some difficulties comparing XML files.
    According to XML specs the order of the attributes is not significant.

    So these 2 statements when XML is concerned are equivalent:
    Code:
    <param7 mappings="1" min="0.6" max="0.8" value="0.200264"/>
    same as
    Code:
    <param7 min="0.6" max="0.8" mappings="1" value="0.200264"/>
    However BC4 will show them as different.

    QT for example will save XML every time with attributes in a random order.

    Is there a way to configure BC4 to get it to show those lines as the same?

    Thank you for any help
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    The Text Compare considers the positioning as important, but can align character by character within a line. If components are out of order, this will detect as a difference, but we do have File Formats which can sort or tidy the XML files, including resorting the attributes, available for download here:
    http://www.scootersoftware.com/downl..._moreformatsv4
    Aaron P Scooter Software

    Comment

    • kristiaan
      New User
      • Feb 2018
      • 2

      #3
      Thank you, that was exactly what I needed!

      Comment

      Working...