开发者

rss rome create entries with <content:encoded /> tag

开发者 https://www.devze.com 2023-01-16 01:12 出处:网络
Where can i find a simple tutorial on how to generate <content:encoded /> tags in an rss using rome?

Where can i find a simple tutorial on how to generate <content:encoded /> tags in an rss using rome?

I开发者_如何学C've been reading throug their documentation but it is only about read and parse from a feed. And their javadoc is minimal...

Thank you!

Udo.


This tutorial includes a part for creating an entry with data that has a content type of text/html:

entry = new SyndEntryImpl();
entry.setTitle("ROME v3.0");
entry.setLink("http://wiki.java.net/bin/view/Javawsxml/Rome03");
entry.setPublishedDate(DATE_PARSER.parse("2004-07-27"));
description = new SyndContentImpl();
description.setType("text/html");
description.setValue("<p>More Bug fixes, mor API changes, some new features and some Unit testing</p>"+
                     "<p>For details check the <a href=\"http://wiki.java.net/bin/view/Javawsxml/RomeChangesLog#RomeV03\">Changes Log</a></p>");
entry.setDescription(description);
entries.add(entry);

I think that should be transformed into a content:encoded element in the generated feed, perhaps depending on the feed type.

EDIT: this was my first answer, but it has nothing to do with ROME:

Don't know if this is what you're looking for, but the RSS Best Practices Profile describes what should be in the element:

The content:encoded element defines the full content of an item (optional). This element has a more precise purpose than the description element, which can be the full content, a summary or some other form of excerpt at the publisher's discretion.

The content must be suitable for presentation as HTML and be encoded as character data in the same manner as the description element.

0

精彩评论

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