문제

It is recommended to add to RSS 2.0.

I am wondering if there is any Rome module available to add this tag? Like what they developed for content, media, etc.

도움이 되었습니까?

해결책

The blog post Adding Atom links to an RSS feed generated by ROME answers exactly that question:

there is no build-in immediate support for Atom elements inside an RSS feed ... I’ve implemented an AtomContent class that holds a list of com.sun.syndication.feed.atom.Link but is easy extensible.

The code is published as https://github.com/michael-simons/java-syndication .

다른 팁

It's not a module, but you can use Channel.getForeignMarkup() if you want to add simple elements to your Channel.

org.jdom2.Element atomLink = new Element("link", org.jdom2.Namespace.getNamespace("atom", "http://www.w3.org/2005/Atom"));
atomLink.setAttribute("href", "http://dallas.example.com/rss.xml");
atomLink.setAttribute("rel", "self");
atomLink.setAttribute("type", "application/rss+xml");

channel.getForeignMarkup().add(atomLink);
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" href="http://dallas.example.com/rss.xml" rel="self" type="application/rss+xml" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top