The XML file structure is like this.
<?xml version="1.0" encoding="UTF-8"?>
<Application>
<Tabs>
<Tab name="1">
<title>abcd</title>
<description>xyz</description>
</Tab>
<Tab name="2">
<title>abcde</title>
<description>xyzw</description>
</Tab>
</Tabs>
<Files>
</Files>
</Application>
I would like to read only the Tabs section using XmlReader in asp.net 2.0. The values that I’m interested in are the title and description contents. There are in total 7 tabs which can increase also later on. Hence can’t iterate over a count variable with value fixed.
If you can use
XPathDocument, you can try something like this.Note: If you already have a
XmlReaderinstance, instead of usingStringReader, you can use the constructor overload that takeXmlReader.