Well,
The scenario is here.
I've books information in xml file.
And the structure of file as below:
<catalog>
<book>
<title />
<author />
<genre />
<price />
.
.
</book>
</catalog>
And I need to get all the authors and genre of books under two groups (By Author, By Genre).
So, I figure this out by help of Google:
I load document via XElement.
XElement doc = XElement.Load(SourcFile );
and use loop to add values of author (for example) under the Author Group.
foreach (XElement author in doc.Descendants("author"))
{
NewNode = AuthorGroupNode.Nodes.Add(author.Value);
}
So, that' the story. But in this solution there is one thing to improve which is repeated values if some books have same author.
It is next task to do.
Thanks for time.
Regards,
Itz.Irshad