Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLHow to clean up HTML in a feedHow to clean up HTML in a feed
Previous
 
Next
New Post
6/12/2006 7:03 AM
 
I tried using the News Feeds  module to display a feed from a remote site, the problem is that the feed is not 'clean' and in it's 'Description' tag consists of raw HTML, which sometimes has unclosed tags: a real mess.

So I googled up on XSL to try and transform the feed so the DNN News Feed would not choke on it, but with no luck. I would like to keep the HTML tags and not strip them out, if possible (realizing that there will be some issues when the HTML tags are unclosed).

Here is a sample of the feed:

<rss version="2.0">

    <channel>
<title>News Feed</title>
<description/>
<link>http://www.website.com/forum/index.php</link>
<pubDate>Mon, 12 Jun 2006 06:59:54 -0400</pubDate>
<ttl>5</ttl>

    <item>
<title>Psp Tv Receiver</title>

    <link>
http://www.website.com/forum/index.php?showtopic=69137
</link>

    <description>
need info. can you get a bolt on TV receiver for a PSP in the UK?
</description>
<pubDate>Mon, 12 Jun 2006 05:54:02 -0400</pubDate>
<guid isPermaLink="false">69137</guid>
</item>

 
New Post
6/12/2006 7:41 AM
 

Hi flyerstarter,

the DNN news feeds are alright, please give me the URL if it is not. Did you disable the output escaping?

 
New Post
6/12/2006 12:39 PM
 
Hi,

Sorry, I didn't even notice that the example I posted has no HTML in it. :)

Here is a more problematic example:

<item>
<title>Bacardi B-live Party With Quentin Harris</title>

    <link>
http://www.undergroundhouse.net/forum/index.php?showtopic=69163
</link>

    <description>
<img src="http://www.ultragroove.co.uk/uploads/images/imagesHome/blive-1.jpg" border="0" alt="IPB Image" /><img src="http://www.ultragroove.co.uk/uploads/images/imagesHome/blive.jpg" border="0" alt="IPB Image" />
</description>
<pubDate>Mon, 12 Jun 2006 12:13:37 -0400</pubDate>
<guid isPermaLink="false">69163</guid>
</item>

The XSL sheet I created to deal with this is as follows (im not sure where to place the output escaping line you suggested?):

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
        <xsl:for-each select="root/pageinfo/description">
            <xsl:copy-of select="p" />
        </xsl:for-each>
  </xsl:template>
  <xsl:template match="p">
    <xsl:copy-of select="." />
  </xsl:template>
</xsl:stylesheet>


 
New Post
6/13/2006 7:14 AM
 

Flyerstarte, I don't get this:

  • Xpath root/pageinfo/description does not match to your example
  • Why do you want to copy xml nodes?
  • There are no p tags inside your example.

In standard rss feeds the content of the description is html escaped, so there are no  tags inside. It is neither Xml or Html. For example there is &lt; instead of <p>.

Reading your example i assume that it contains the following XML as text:

 <description>
&lt;img src="http://www.ultragroove.co.uk/uploads/images/imagesHome/blive-1.jpg" border="0" alt="IPB Image" /&gt;&lt;img src="http://www.ultragroove.co.uk/uploads/images/imagesHome/blive.jpg" border="0" alt="IPB Image" /&gt;
</description>

IE will shows it like this, please not the black font color inside description.

<description>
<img src="http://www.ultragroove.co.uk/uploads/images/imagesHome/blive-1.jpg" border="0" alt="IPB Image" /><img src="http://www.ultragroove.co.uk/uploads/images/imagesHome/blive.jpg" border="0" alt="IPB Image" />
</description>

You would normally access the node like <xsl:value-of select="description" disable-output-escaping="yes"/> .

 
New Post
7/22/2006 6:07 PM
 
Hi Stefan,

Sorry for the delay in response.

I am quite confused already. :)

Basically what I would like to to do is take a feed such as:

 http://www.lounge72.com/root/xml.php

and present it in the XML/XSL module in a human-readable form (aka, no tags). I need to know the XSL file required for this .. 

Thanks
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLHow to clean up HTML in a feedHow to clean up HTML in a feed


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out