I’m using Linq to get some xml values, but this time I want to get the content of “href” attribute from tag, which is like this:
<link rel="alternate" type="text/html" href="Value I want to retrieve"/>
<link rel="alternate" type="text/html" href="Another Value want to retrieve"/>
any clues how to do that?
I am able to get values of tags
<title>1st title</title>
<title>2nd title</title>
this way:
IEnumerable<XElement> item = document.Descendants(xmlns + "title");
// to print use: item.ElementAt<XElement>(0).Value;
But I failed to retrieve a value from the href attribute, any help is appreciated.
How about this:
… or just: