how to compare XML strings in C#?

mattzz77

New Member
In DB I have XML strings stored in a column. Below is my XML structure:\[code\]<?xml version="1.0"?>-<ProductAttributes xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">-<Attribute Required="false" ID="2" Name="Color"><Value ID="18">Light Pink</Value></Attribute>-<Attribute Required="false" ID="1" Name="Size"><Value ID="9">XL</Value></Attribute></ProductAttributes>\[/code\]Another XML is:\[code\]<?xml version="1.0"?>-<ProductAttributes xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">-<Attribute Required="false" ID="1" Name="Size"><Value ID="1">S</Value></Attribute>-<Attribute Required="false" ID="2" Name="Color"><Value ID="4">Red</Value></Attribute>-<Attribute Required="false" ID="3" Name="Weight"><Value ID="6">10gr</Value></Attribute></ProductAttributes>\[/code\]Notes[*]There can be n number of xml strings and each xml string can have m number of tags[*]Attribute nodes can in different order, for example in 1st attribute Id=1 can be first attribute and in 2nd attribute Id=1 can be last.Requirement is not compare these n XML strings and find if any of strings has complete duplication of attributes (this comparison will consider values as order can be different).Please guide and help me.
 
Back
Top