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  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
 


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 4: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 4:41 AM
User is offline Stefan Cullmann
1452 posts
6th 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

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

Need to import external data to a UDT? Try http://www.codeplex.com/Csv2UDTImport

 
New Post 6/12/2006 9: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 4:14 AM
User is offline Stefan Cullmann
1452 posts
6th 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

forms & Lists (UDT5.0) will be the next major release of the User Defined Table project.
A first Preview is available, though it requires DotnetNuke 5 (Beta 5).

Need to import external data to a UDT? Try http://www.codeplex.com/Csv2UDTImport

 
New Post 7/22/2006 3: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.

 


Active Modules, Inc.
Creators of Active Forums, the best forum module for DotNetNuke
www.activemodules.com
DotNetNuke Marketplace - Modules & Skins
The DotNetNuke Marketplace is the official e-commerce gateway for the DNN ecosystem. It's the place to buy and sell DotNetNuke modules, DotNetNuke skins, and other DNN offerings.
DotNetNuke Marketplace
ExactTarget Email Marketing Software and Solutions
ExactTarget delivers on-demand email software solutions for permission-based email marketing. ExactTarget offers solutions that meet the needs of all industry verticals and all size organizations, including SMB, corporate divisions, not-for-profits, large retail/direct marketers, agencies and enterprises.
ExactTarget.com

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