Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - How to Compare DOMs for Unit Tests? [Thread Next] Re: How to Compare DOMs for Unit Tests?To: NULL Date: 12/24/2008 10:00:00 AM "Siegfried Heintze" <siegfried@h...> wrote in message news:u0yUsfUZJHA.1272@T...... > I'm using Microsoft C++ V15 to serialize DOMs to disk using MSXML. > > I want to write some unit tests to verify that I am producing the same > DOMs. I might use SAX in the future. > > Should I compare XML files? Is there a tool to do this so that it > appropriately ignores white space? Or should I deserialize the standard > XML file into a DOM and compare it with my in memory copy? Uggh, that > sounds ugly! > > > Thanks, > Siegfried > It's not a trivial task as you need to compare at the infoset level rather than as a file compare. (For example <node att="1"/> is the same as <node att='1' /> at the infoset level but not at the file level.) XmlDiff can be used manually, I don't know if it has an API though. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
