I have a Drupal site setup. The rss that it sends out for the feed is simple, the page has one image and some text for testing.
In another environment – non Drupal – I am importing the feed on a jsp page with transforming the xml.
<c:import url="http://myfeedurl/rss.xml" var="inputDoc" scope="session"/>
<c:import url="drupal.xsl" var="stylesheet" />
<x:transform xml="${inputDoc}" xslt="${stylesheet}"/>
Everything works properly, as in grabbing the xml stream and rendering it on the page. However it is spitting out the html tags in the content. So instead of seeing “This is a test” I am seeing <div class="field-item even" property="content:encoded"><p>This is a test</p> </div>
I am wondering if this is a Drupal rss issue, or if I need something on my rendering end. I have done this before with other rss feeds and it displays properly.
When you view the source on the correct rss feeds the xml is all there in the tags as it is supposed to be.
When you view the source on this drupal feed it looks like this <div class="field-item even" property="content:encoded"><p>This is a test</p> instead of html.
</div>
Any help would be appreciated….
Drupal is using HTML entities to preserve the tags. If you don’t want that, you need to strip them on Drupal’s side of things. The exact method depends on the way you generate the feed.
If you do want them, you need to decode the entities before rendering it, otherwise the escaped entities will show up as characters. You can use http://commons.apache.org/lang/api-2.6/org/apache/commons/lang/StringEscapeUtils.html#unescapeHtml%28java.lang.String%29 for this.