I have been doing a lot of reading on LINQ to XML but unfortunately this topic (which is fairly new to me) simply will not click. Having said that, please feel free to correct any misspeaks regarding proper XML vocabulary. My goal is to take XML data, (shown below), and read it node by node. In this instance, I want to be able to open the Delimiters node, in order to obtain the values of the "one", "two", and "three" elements. Next, I would like to obtain the values of the "one", "two", and "three" elements from within the Sources/SourceType nodes.
<?xml version="1.0"?>
<Values>
<Delimiters>
<one>delim 1</one>
<two>delim 2</two>
<three>delim 3</three>
</Delimiters>
<Sources>
<SourceType>
<one>type 1</one>
<two>type 2</two>
<three>type 3</three>
</SourceType>
</Sources>
</Values>
I have read on XMLTextReader
as well as XMLReader
but I would like to hear from all of you what the best practices are for my situation here.
Thank you for reading,
Evan