Sorting Identity Manager DriverSet XML


I often find myself trying to compare the full DriverSet XML between environments to ensure I copied all changes from and to each environment. This was a pretty tedious task because drivers and rules are listed in the XML in the order they were initially imported (I believe), and not much of that matches between my environments. So I would often have to manually sort the drivers, and then sometimes try to sort rules within drivers to make sure I could do a good comparison.

I got tired of doing this so I wrote a small Perl script that does the sorting for me. I've only tested it with my environments, so I don't know how well this would work in anyone else's DriverSet.

Once I run both XMLs I want to compare through the script, I can then compare the output with WinMerge or Notepad . I'm sure a simple diff on the command line would work, but I like having the visual aid of those other tools, especially when trying to track down which driver a difference belongs to.


How To-Best Practice
Comment List
  • Cool idea Joel - In my case, I used a stylesheet to simply alphabetize the sub rules, and this has mostly resolved the issue; and we call this process 'normalizing' before we check in drivers into our source code repository. The code looks pretty complicated, can I ask what sorting key you decided to use? Was it just arbitrary like alphabetizing like I did?