我正在尝试<content:encoded>
使用 ROME 及其模块将一些 HTML 内容放入标签中。到目前为止,我已成功地将 mediaRSS 和 geoRSS 放入提要中,但我的内容没有显示出来。
这是我的代码:
ContentModule contentModule = new ContentModuleImpl();
List<ContentItem> contents = new ArrayList<ContentItem>();
List<String> contentValueDOM = new ArrayList<String>();
ContentItem content = new ContentItem();
content.setContentValue("<p>Some text here</p>");
content.setContentEncoding("text/html");
content.setContentAbout("Paragraph");
content.setContentValueDOM(contentValueDOM);
contents.add(content);
contentModule.setContents(contents);
contentModule.setContentItems(contents);
entry.getModules().add(contentModule);
这是我的输出
<item>
<title>Example page</title>
<link>http://www.example.com/news/2012/march/example-page.html</link>
<description>Introduction</description>
<category>news</category>
<pubDate>Tue, 27 Mar 2012 08:18:52 GMT</pubDate>
<guid>http://www.example.com/news/2012/march/example-page.html</guid>
<dc:date>2012-03-27T08:18:52Z</dc:date>
<content:items>
<rdf:Bag>
<rdf:li>
<content:item rdf:about="Paragraph">
<content:encoding rdf:resource="text/html" />
<rdf:value />
</content:item>
</rdf:li>
</rdf:Bag>
</content:items>
<geo:lat>52.09161879618039</geo:lat>
<geo:long>5.1141280958007655</geo:long>
<media:content medium="image" fileSize="16029" height="500" type="image/jpeg" width="399" url="http://www.example.com/binaries/content/gallery/image.jpg">
<media:description type="plain/text" />
<media:thumbnail url="http://www.example.com/binaries/content/gallery/thumbnail/image.jpg" />
</media:content>
<media:content medium="video" expression="full" type="application/x-shockwave-flash" isDefault="true" url="http://www.youtube.com/v/jQq4ju-vupY?rel=0">
<media:player url="http://www.youtube.com/v/jQq4ju-vupY?rel=0&feature=youtube_gdata_player" width="520" height="390" />
</media:content>
</item>