How can I compare the content of two (or more) large .resx files? With hundreds of Name/Value pairs in each file, it'd be very helpful to view a combined version. I'm especially interested in Name/Value pairs which are present in the neutral culture but are not also specified in a culture-specific version.
You can use a tool like TortoiseSVN's diff (if you're using windows), just select both files, right click and then select "diff" form the tortoise submenu.
Using simple diff on XML files can be totally useless, if the matching elements do not appear in the same order in both files. I have been looking for an XML-specific diff tool too, so far without success.
In the meantime, the workaround I have been using is this:
- Open the resx files in the VS.
- Select all [CTRL-A] and cut [CTRL-X] (this may take a while for large files - be patient)
- Paste [CTRL-V] and save (this will re-create the resx files sorted by keys)
When both files are thus re-ordered, normal diff'ing becomes so much easier. You can quickly locate the missing keys by skimming through the diff now.
Although it's not a diff tool per se, RESX Synchronizer may help you out here. Its main use is to update the localized .resx files with new entries from the neutral language one, and remove any deleted items.
Possibly, the output generated by using it with the /v command line switch will be what you need. Otherwise, it does come with full C# source code, so possibly you can adapt it for your needs.
There is a great freeware tool to edit resx files where you can see multiple languages at once and clearly see what is missing or extra - Zeta Resource Editor
I've tried several XMl Diff tools. Here's the summary(The requirement driven me to evalute is to diff the VS generated resx resource file, which I think microsoft make a big fault, the order of element is random, and WinForms always re-write the ImageStream if you just change a button's location and do nothing with the imageList)
- XmlDiff
- Araxis
- Altova DiffDog
- Xml Notepad
- examXML
- Liquid XML Studio 2009(There's a XML diff menu, but only a license version can use it. so I have no chance to give a try)
First of all, all the normal diff tools should not be considered because they know nothing of XML, they treat text files as just line of text.
XmlDiff is the first tool I tried. It looks that it can do want I need, but after download the source code(VS2003) and compiled with VS2005(with a success auto grade) I can compile the small project smoothly. But when I compare two real resx file(1295 lines) it crashed. Debuging into the code does not give me a clue about what happened because I have no source code of the xmldiffpatch.dll XmlDiffPatch.View.dll And why I not try to choose to dig more in this tool is the output format, or GUI design, it output a HTML file with difference highlighted in a IE-hosted window. For large XML file diff, it's not easy to use.
Xml Notepad has a simple builtin XML diff, according to the output window I think it internally use XmlDiff 's component. And the output is same as XmlDiff. I'll uninstall it.
Araxis is much more a traditional text diff tool, it can also compares binary file, image file, folder, and word files, I like it very much for any diff task except XML, because it has not XML-aware diff options support
Altova DiffDog Looks a complicated commerical product and it did contains an option to ignore the element order, which is the key feature for me.
But after trying it with the same real resx file(1295 lines, not a big one in my experience), I found that the "ignore element order" just not works well if the two element located at the very differenct places in the two files.
- examXML Looks a commerical product but a small product, but after trying it I found it's the most idea tool at present on my expectations.
There's also disappoint side: it crashed when I press F10 to navigate to next difference. The ignore order of element works well. There's one pitty that the customization of ignored element is not so much flexible.
label1.Size label1.Location label1.Width
I want to ignore all the difference on these elements whose name contains ".Size" or ".Location" or ".Width", but it's not possible to define such a condition at the same time. The customization doesnot support regular expression.
Anyway, I'll use examXML (with careful) to compare XML files.