Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  XML Module [Lea...  How to clean up HTML in a feed
Previous Previous
 
Next Next
New Post 6/12/2006 5:03 AM
User is offline Keith Tuomi
73 posts
www.flyerstarter.com
10th Ranked


How to clean up HTML in a feed 
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 5:41 AM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: How to clean up HTML in a feed 

Hi flyerstarter,

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


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 6/12/2006 10:39 AM
User is offline Keith Tuomi
73 posts
www.flyerstarter.com
10th Ranked


Re: How to clean up HTML in a feed 
Modified By Keith Tuomi  on 6/13/2006 2:50:57 AM)
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 5:14 AM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: How to clean up HTML in a feed 

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"/> .


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 7/22/2006 4:07 PM
User is offline Keith Tuomi
73 posts
www.flyerstarter.com
10th Ranked


Re: How to clean up HTML in a feed 
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 Previous
 
Next Next
  Forum  DotNetNuke® Pro...  XML Module [Lea...  How to clean up HTML in a feed
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


ASP.NET Web Hosting for $3.95
3 Month FREE ASP.NET Hosting! FREE Setup! DNN Support! FREE Domain Name! FREE Components! Host multiple websites on 1 plan! 30 Days Money Back Guarantee!
www.dailyrazor.com
Cestus Websites
DotNetNuke websites en services in Nederland. Cestus Websites levert websites, projectmanagent, skins, modules, training en gespecialiseerde hosting op basis van het CMS DotNetNuke.
www.dotnetnuke-websites.nl
FREE Skins, Modules & Control Panel!
Choose how much you want to pay on our Skins, Modules, Containers and Control Panel - Starting from FREE!
www.dnngroup.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP