1
我想解析的YouTube的XML飼料和循環通過某個用戶的視頻,你是怎麼做到的?我正在使用umbraco剃刀(c#)。YouTube的飼料解析XML C#剃鬚刀
@using System;
@using System.Linq;
@using System.Collections.Generic;
@using System.Xml;
@using umbraco.MacroEngines;
@using System.Xml.Linq;
@inherits System.Xml.XPath.XPathNodeIterator;
@inherits umbraco.MacroEngines.DynamicNodeContext;
@inherits DynamicNodeContext
@{
dynamic xmlv = new DynamicXml(umbraco.library.GetXmlDocumentByUrl("https://gdata.youtube.com/feeds/api/users/[username]/uploads"));
<ul>
@foreach (var property in xmlv.BaseElement.Elements.Where(x => x.Elements("Name") == "group"))
{
<li>
<p>
@property.Title
@property.Content
@property.Thumbnail
</p>
</li>
}
</ul>
}
感謝,當場。 – PeteTheGreek
我注意到在YouTube媒體中有另一個字段:group元素,,你將如何訪問它? –
PeteTheGreek
已分類。 http://stackoverflow.com/questions/12019152/get-xml-namespace-elements-with-c-sharp – PeteTheGreek