开发者

How to avoid empty RSS Feed tags with javascript?

I've got my RSS feed in xml file which I can not edit. The problem is that some of the tags inside are empty or they contain other html tags such as <b></b>. I built my开发者_JAVA技巧 own JavaScript rss feed reader but it's not working unless I will get rid of all empty tags and all html tags. Any ideas?

Example 1 - which doesn't work:

/* ... */
<item>
<pubDate>04 Feb</pubDate>
<closeDate>11 Feb</closeDate>
<snappytitle></snappytitle>
<title><b>Web Developer</b></title>
<grade>4</grade>
</item>
/* ... */

Example 2 - which does work:

/* ... */
<item>
<pubDate>04 Feb</pubDate>
<closeDate>11 Feb</closeDate>

<title>Web Developer</title>
<grade>4</grade>
</item>
/* ... */


Well.. the thing is that I can not edit xml file as it's provided by the third party. To read this xml I am using modify version of the simple javaScript Ajax Feed reader which I found here

I am note sure how to modify this script to still work even if some tags inside of the xml file are empty.. as per example I have before.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜