Is there an easy way to compare if 2 XDocuments are equal ignoring element/attribute order?

Posted by Davy8 on Stack Overflow See other posts from Stack Overflow or by Davy8
Published on 2009-05-17T22:13:59Z Indexed on 2010/05/26 10:41 UTC
Read the original article Hit count: 337

Filed under:
|
|
|

Unit testing my serialization code I found one failed because I had attributes listed in a different order (I'm just comparing the XDocument.ToString() values) and while I could fix that, it really doesn't matter to me in what order the elements or attributes appear as long as they're all there with the right name at the right level of hierarchy. I could probably write a method do this, but I'm wondering if there's an easy built in way I'm not aware of.

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml