What do you suggest to use for parsing such as this XML file:
<file>
<test1 a="true">
<line1>aaa</line1>
<line2>aaa</line2>
<line3>aaa</line3>
<line4>aaa</line4>
</test1>
<test2 a="true">
<line1>aaa</line1>
<line2>aaa</line2>
<line3>aaa</line3>
<line4>aaa</line4>
</test2>
<test3 a="false">
<line1>aaa</line1>
<line2>aaa</line2>
<line3>aaa</line3>
<line4>aaa</line4>
</test3>
</file>
- XmlReader
- XmlTextReader
- something another?
I’m looking for the fastest and shortest way. I tried with XmlReader but it needs to much extra variables to check which element is parasing currently.
Thanks in advance.
C.H.
–update 1–
The work which i want to do is assigning each element of tests to struct “test”
Look in to Linq to XML. I can’t speak to ‘fastest’, but it certainly makes my life easier when working with XML.