将HTML元素转换为XML / RSS [英] Converting HTML elements into XML/RSS

查看:52
本文介绍了将HTML元素转换为XML / RSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想将整个网页内容(而不仅仅是

标题)包含在RSS / XML中让人们通过rss阅读它们

读者。


问题:如何转换HTML元素,如href,img,b,p等

到XML?

我见过有人在他们的RSS提要中使用以下内容但我不喜欢

因为< pre> ;并没有产生一个很好的格式:


< content:encoded><![CDATA [

< PRE>

blah blah blah ..


这是一个示例HTML代码。什么是最好的方式将它放入

XML,更具体地说,转换那些HTML元素。


---------- ------

< b> CAESAR< / b> Et tu,Brute!然后跌倒,

< a

href = http://www.epilepsiemuseum.de/raum6/caesar.jpg> Caesar< / a>。< br>

死亡

< p>

< b> CINNA< / b>自由!自由!暴政已经死了!

因此,在街道上宣传,哭泣。

< a href = http://www.shakespeare-online.com/>阅读更多< / a> ;.

-----------------


感谢您的帮助!


Mick James

解决方案

2005年1月6日13:43:19 -0800 , mi******* @ gmail.com 写道:

我想将整个网页内容(而不仅仅是
标题)包含在RSS / XML中,以便人们通过rss feed
读者阅读它们。




阅读本文
http://diveintomark.org/archives/200...compatible-rss


再次询问是否有任何不清楚的地方。


谢谢。


所以所有HTML都需要包含在< description>中和标签需要

与& amp; lt;和& amp; gt;?


在文章< 11 ****************** ****@f14g2000cwb.googlegroups .com> ;,
mi ******* @ gmail.com 写道:

我想将整个网页内容(而不仅仅是
标题)包含在RSS / XML中,以便人们阅读他们通过rss feed
读者。


呃,这是用户希望成为摘要的很多内容。

为什么使用Feed如果它不能保存您的用户是什么?

问题:如何将HTML元素(如href,img,b,p等)转换为XML?


考虑到上述情况,自由混合它,只需使用命名空间来区分元素。既然你已经打破了饲料的目的,那么通常用传统的客户端软件正常工作

不是问题。

以下是HTML代码示例。什么是最好的方式进入




看起来更像是标签汤给我。


-

Nick Kew


Hi,

I''d like to include the whole web page content (as opposed to just the
headlines) into RSS/XML to enable people to read them via rss feed
readers.

Question: how to convert HTML elements such as href, img, b, p, etc
into XML?
I''ve seen someone use the following in their RSS feed but I don''t like
it because <pre> doesn''t produce a nice format:

<content:encoded><![CDATA[
<PRE>
blah blah blah..

Here is a sample HTML code. What would be the best way to put it into
XML, more specifically, convert those HTML elements.

----------------
<b>CAESAR</b> Et tu, Brute! Then fall,
<a
href=http://www.epilepsiemuseum.de/raum6/caesar.jpg>Caesar</a>.<br>
Dies
<p>
<b>CINNA</b> Liberty! Freedom! Tyranny is dead!
Run hence, proclaim, cry it about the streets.
<a href=http://www.shakespeare-online.com/>Read more</a>.
-----------------

Thanks for all the help!

Mick James

解决方案

On 6 Jan 2005 13:43:19 -0800, mi*******@gmail.com wrote:

I''d like to include the whole web page content (as opposed to just the
headlines) into RSS/XML to enable people to read them via rss feed
readers.



Read this
http://diveintomark.org/archives/200...compatible-rss

Ask again if anything is unclear.


Thanks.

So all the HTML needs to be enclosed in <description> and tags need to
be escaped with &amp;lt; and &amp;gt;?


In article <11**********************@f14g2000cwb.googlegroups .com>,
mi*******@gmail.com writes:

I''d like to include the whole web page content (as opposed to just the
headlines) into RSS/XML to enable people to read them via rss feed
readers.
Uh, that''s a lot of content for what users are expecting to be a summary.
Why use a feed if it doesn''t save your users anything?
Question: how to convert HTML elements such as href, img, b, p, etc
into XML?
Bearing in mind the above, freely mix it, just using namespaces to
distinguish the elements. Since you''re already breaking the purpose
of a feed, working normally with conventional client software presumably
isn''t an issue.
Here is a sample HTML code. What would be the best way to put it into



Looks more like tag-soup to me.

--
Nick Kew


这篇关于将HTML元素转换为XML / RSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆