I have a tag and I am trying to get the actual text from it.
An example of this tag is: (And all are formatted the same)
<description>
<div class="field field-name-field-body-small field-type-text-long field-label-hidden">The evolution of your League of Legends match history is now live!
</div>
<div class="field field-name-field-article-media field-type-file field-label-hidden">
<div id="file-13180" class="file file-image file-image-jpeg">
<img typeof="foaf:Image" src="/sites/default/files/styles/large/public/upload/mh_640x360.jpg?itok=z_Nn84Op" width="480" height="270" alt="" title="" />
</div>
</div>
<div class="field field-name-custom-author field-type-entityreference field-label-hidden">
<span class="article_detail"><span class="posted_by">By Riot MattEnth</span>
</span></div>
</description>
I want the text on the first line, which in this example contains (far right of code snippet)
The evolution of your League of Legends match history is now live!
Is there a simple way to do this with my following code? Right now it returns that entire string of junk.
XDocument xmlFile = XDocument.Load(@"http://na.leagueoflegends.com/en/rss.xml");
var LoLdescriptions = from service in xmlFile.Descendants("item")
select (string)service.Element("description");
ViewBag.descriptions = LoLdescriptions.ToArray();
...moving into View...
@ViewBag.descriptions[0]
If this is not hard, is there also a way to the get the last line as well? In this case By Riot MattEnth
Thank you!
XML code for reference: http://na.leagueoflegends.com/en/rss.xml