Sunday, 6 December 2015

XML : C#: Parse Nested XML File With Same Tags

XML File:

  <?xml version="1.0" encoding="utf-8"?>  <grid table="Declaration">      <primary_key>Some String</primary_key>      <query>          Some String      </query>      <grid table="GoodsItem">          <foreign_key>Some String</foreign_key>          <primary_key>Some String</primary_key>          <query>              Some String          </query>          <grid table="GoodsItemGUID">              <foreign_key>Some String</foreign_key>              <foreign_key>Some String</foreign_key>              <primary_key>Some String</primary_key>              <query>                  Some String              </query>          </grid>      </grid>  </grid>    

As you can see "grid" element contains same "grid" elements, that can also contain "grid" elements, so i want to parse this xml file in general way not only for this xml file. what is best way to do it?

No comments:

Post a Comment