如何将 SyndicateElementExtension 添加到 SyndicateItem
使用 .NET System.ServiceModel.Syndicate 类...
我想向 SyndicateItem 添加一个新的 SyndicateElementExtension,它将导出以下 XML:
<media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123" />
大致如下:
syndicationItem.ElementExtensions.Add(new SyndicationElementExtension("thumbnail", "http://video.search.yahoo.com/mrss", ?
如何创建具有一些属性的简单 SyndicateElementExtension?
Using the .NET System.ServiceModel.Syndication classes...
I would like to add a new SyndicationElementExtension to a SyndicationItem that will export the following XML:
<media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123" />
Something along the lines of:
syndicationItem.ElementExtensions.Add(new SyndicationElementExtension("thumbnail", "http://video.search.yahoo.com/mrss", ?
How do you create a simple SyndicationElementExtension with a few attributes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了简化下一个试图解决这个问题的人,这里有一个按照文档的内容添加基本项目缩略图(在本例中为 RSS 2.0 附件)的工作示例:
您可以如果您想要一个简单的标签,也可以转储属性并在标签名称后设置文本内容,即
http://my.comments/feed
。Just to simplify for the next guy who comes along trying to figure this out, here's a working example of adding a basic item thumbnail (RSS 2.0 enclosure in this case) along the lines of the documentation:
You can also dump the attributes and just set textual content after the tag name if you want a simple tag, i.e.
<comments>http://my.comments/feed</comments>
.在这里找到答案:http://msdn.microsoft.com/en-us/库/bb943475.aspx
Found the answer here: http://msdn.microsoft.com/en-us/library/bb943475.aspx