【发布时间】:2011-10-15 18:28:17
【问题描述】:
我正在使用 Xelement - Linq to XML 来解析一些 RSS 提要。
Rss 示例:
<item>
<title>Waterfront Ice Skating</title>
<link>http://www.eventfinder.co.nz/2011/sep/wellington/wellington-waterfront-ice-skating?utm_medium=rss</link>
<description><p>An ice skating rink in Wellington for a limited time only!
Enjoy the magic of the New Zealand winter at an outdoor skating experience with all the fun and atmosphere of New York&#039;s Rockefeller Centre or Central Park, ...</p><p>Wellington | Friday, 30 September 2011 - Sunday, 30 October 2011</p></description>
<content:encoded><![CDATA[Today, Wellington Waterfront<br/>Wellington]]></content:encoded>
<guid isPermalink="false">108703</guid>
<pubDate>2011-09-30T10:00:00Z</pubDate>
<enclosure url="http://s1.eventfinder.co.nz/uploads/events/transformed/190501-108703-13.jpg" length="5000" type="image/jpeg"></enclosure>
</item>
一切正常,但描述元素有很多我需要删除的 html 标记。
说明:
<description><p>An ice skating rink in Wellington for a limited time only!
Enjoy the magic of the New Zealand winter at an outdoor skating experience with all the fun and atmosphere of New York&#039;s Rockefeller Centre or Central Park, ...</p><p>Wellington | Friday, 30 September 2011 - Sunday, 30 October 2011</p></description>
有人可以帮忙吗?
【问题讨论】:
-
“忽略 html 代码”是什么意思。您要提取纯文本吗?
-
@AVD 是的,我只想提取文本,忽略标记。
-
看看这个链接 - dotnetperls.com/remove-html-tags
标签: c# linq windows-phone-7