Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Sorting xml nodes using elements in c#

$
0
0

Hi, I have the below XML element that need to sorted based on date of birth

            <Info>
<EmployeeDetail>
                <field fieldKey="Employee Name" name="EMPLOYEE NAME" value="Chirs"/>
                <field fieldKey="date of birth" name="DATE OF BIRTH" value="02-07-1990"/>
                <field fieldKey="Salary" name="SALARY" value="6,458"/>
              </EmployeeDetail>
              <EmployeeDetail>
                <field fieldKey="Employee Name" name="EMPLOYEE NAME" value="Mothie"/>
                <field fieldKey="date of birth" name="DATE OF BIRTH" value="13-08-2000"/>
                <field fieldKey="Salary" name="SALARY" value="6,458"/>
              </EmployeeDetail>
  <EmployeeDetail>
                <field fieldKey="Employee Name" name="EMPLOYEE NAME" value="Manie"/>
                <field fieldKey="date of birth" name="DATE OF BIRTH" value="03-07-1990"/>
                <field fieldKey="Salary" name="SALARY" value="6,458"/>
              </EmployeeDetail>
</Info>


Output should be like this 
"<Info>
  <EmployeeDetail>
                <field fieldKey="Employee Name" name="EMPLOYEE NAME" value="Mothie"/>
                <field fieldKey="date of birth" name="DATE OF BIRTH" value="13-08-2000"/>
                <field fieldKey="Salary" name="SALARY" value="6,458"/>
              </EmployeeDetail>
              <EmployeeDetail>
                <field fieldKey="Employee Name" name="EMPLOYEE NAME" value="Manie"/>
                <field fieldKey="date of birth" name="DATE OF BIRTH" value="03-07-1990"/>
                <field fieldKey="Salary" name="SALARY" value="6,458"/>
              </EmployeeDetail>
  <EmployeeDetail>
                <field fieldKey="Employee Name" name="EMPLOYEE NAME" value="Chirs"/>
                <field fieldKey="date of birth" name="DATE OF BIRTH" value="02-07-1990"/>
                <field fieldKey="Salary" name="SALARY" value="6,458"/>
              </EmployeeDetail>
</Info>"


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>