Here is my XML
<assets>
<asset>
<metadata Id="ItemType" Value="Image"/>
<metadata Id="ItemUri" Value="http://blah.png"/>
</asset>
<asset>
<metadata Id="ItemType" Value="Image"/>
<metadata Id="ItemUri" Value="http://blah2.png"/>
</asset>
</assets>
How do I get the 2nd <metadata>
's value containing the URI?
List<Asset> assets = (from asset in xmlDocument.Descendants("asset")
select new Asset
{
ItemType = asset.Element("metadata").Attribute("Value").Value,
ItemUri = asset.Element("metadata").Attribute("Value").Value
}).ToList<Asset>();
Currently my code just returns the same value from the first <metadata>
of course.