Read a XML file using C#.Net

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<ns0:BookStore xmlns:ns0=URI
- <ns1:BookDetails xmlns:ns1= URI1
<ns1:Name>ns0:Name_0</ns1:Name> <br/>
<ns1:PurchaseDate>1999-05-31T13:20:00.000-05:00</ns1:PurchaseDate>
<br/>
<ns1:SlNo>10</ns1:SlNo> <br/>
<ns1:Id>8563452</ns1:Id> <br/>
<ns1:Code>2631</ns1:Code> <br/>
<ns1:Price>800.25</ns1:Price> <br/>
</ns1:BookDetails>
- <ns2:BookDetails xmlns:ns2= URI1
<ns2:Name>ns0:Name_0</ns2:Name> <br/>
<ns2:PurchaseDate>1999-05-31T13:20:00.000-05:00</ns2:PurchaseDate>
<br/>
<ns2:SlNo>20</ns2:SlNo> <br/>
<ns2:Id>8962596</ns2:Id> <br/>
<ns2:Code>2563</ns2:Code> <br/>
<ns2:Price>589.26</ns2:Price> <br/>
</ns2:BookDetails>
- <ns3:BookDetails xmlns:ns3= URI1
<ns3:Name>ns0:Name_0</ns3:Name> <br/>
<ns3:PurchaseDate>1999-05-31T13:20:00.000-05:00</ns3:PurchaseDate>
<br/>
<ns3:SlNo>30</ns3:SlNo> <br/>
<ns3:Id>1589652</ns3:Id> <br/>
<ns3:Code>1589</ns3:Code> <br/>
<ns3:Price>125.00</ns3:Price> <br/>
</ns3:BookDetails><br/>
</ns0:BookStore>

I want to extarct the below 3 results from above XML.
Could you please help me, how to Extarct the below values using C# Window Application?
1: Combination of <ns1:PurchaseDate> + <ns1:SlNo> + <ns1:Id>
2: Combination of <ns2:PurchaseDate> + <ns2:SlNo> + <ns2:Id>
3: Combination of <ns3:PurchaseDate> + <ns3:SlNo> + <ns3:Id>

View the full article
 
Back
Top