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 ForumsNews FeedsNews FeedsHTML tags not effective?HTML tags not effective?
Previous
 
Next
New Post
6/23/2008 11:56 PM
 

I have an XSL style sheet generating HTML tags as it parses my rss (rdf) feed.  I'm trying to put values in a table, but my RSS window just looks like this:

<html><head></head><body> <table><tbody> <tr><th>Date</th><th>Time</th><th>Tide</th><th>Height</th><th>Time</th><th>Event</th></tr> <tr> </tr><tr><td>2008-06-22</td> <td>3:53 PM PDT</td> <td> Hig</td> <td>5.50 feet </td> <td>8</td> <td>Sunset</td> </tr><tr><td>2008-06-22</td> <td>9:01 PM PDT</td> <td> Low</td> <td>3.14 feet </td> </tr><tr><td>2008-06-23</td> <td>2:30 AM PDT</td> <td> Hig</td> <td>6.13 feet </td> <td>5</td> <td>Sunrise</td> </tr><tr><td>2008-06-23</td> <td>9:36 AM PDT</td> <td> Low</td> <td>-0.35 feet </td> </tr><tr><td>2008-06-23</td> <td>4:27 PM PDT</td> <td> Hig</td> <td>5.67 feet </td> <td>8</td> <td>Sunset</td> </tr><tr><td>2008-06-23</td> <td>9:55 PM PDT</td> <td> Low</td> <td>2.93 feet </td> </tr><tr><td>2008-06-24</td> <td>3:19 AM PDT</td> <td> Hig</td> <td>5.68 feet </td> <td>5</td> <td>Sunrise</td> </tr><tr><td>2008-06-24</td> <td>10:13 AM PDT</td> <td> Low</td> <td>0.08 feet </td> </tr><tr><td>2008-06-24</td> <td>5:03 PM PDT</td> <td> Hig</td> <td>5.91 feet </td> <td>8</td> <td>Sunset</td> </tr><tr><td>2008-06-24</td> <td>10:57 PM PDT</td> <td> Low</td> <td>2.58 feet </td> </tr><tr><td>2008-06-25</td> <td>4:18 AM PDT</td> <td> Hig</td> <td>5.17 feet </td> <td>5</td> <td>Sunrise</td> </tr><tr><td>2008-06-25</td> <td>10:51 AM PDT</td> <td> Low</td> <td>0.62 feet </td> </tr><tr><td>2008-06-25</td> <td>5:40 PM PDT</td> <td> Hig</td> <td>6.19 feet </td> <td>8</td> <td>Sunset</td> </tr><tr><td>2008-06-26</td> <td>12:03 AM PDT</td> <td> Low</td> <td>2.04 feet </td> </tr><tr><td>2008-06-26</td> <td>5:31 AM PDT</td> <td> Hig</td> <td>4.68 feet </td> <td>5</td> <td>Sunrise</td> </tr><tr><td>2008-06-26</td> <td>11:34 AM PDT</td> <td> Low</td> <td>1.24 feet </td> </tr><tr><td>2008-06-26</td> <td>6:19 PM PDT</td> <td> Hig</td> <td>6.52 feet </td> <td>8</td> <td>Sunset</td> </tr><tr><td>2008-06-27</td> <td>1:11 AM PDT</td> <td> Low</td> <td>1.32 feet </td> </tr></tbody></table></body></html>

Can I get the News module to respond the way I'm seeking?


 
New Post
6/24/2008 11:28 AM
 

Post your xsl code, I can't tell what's wrong without seeing it.  Include the newsfeed link you are using, if that's applicable.

 
New Post
6/24/2008 2:55 PM
 

RSS URL:

http://www.tides.info/?command=rss&location=Brookings%2c+Chetco+Cove%2c+Oregon

XSL Code:

<?xml version='1.0'?>
<xsl:stylesheet
  version="1.0" exclude-result-prefixes="rdf rss l dc admin content xsl"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                  xmlns:rss="http://purl.org/rss/1.0/"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                  xmlns:admin="http://webns.net/mvcb/"
                  xmlns:l="http://purl.org/rss/1.0/modules/link/"
                  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<!-- phil 'iwonder' guerra - xsl simple rdf translation file. -->
    <xsl:output omit-xml-declaration="yes"/>
   
    <xsl:template match="/rdf:RDF">
    &lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
    &lt;table&gt;&lt;tbody&gt;
        &lt;tr&gt;&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;th&gt;Tide&lt;/th&gt;&lt;th&gt;Height&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;th&gt;Event&lt;/th&gt;&lt;/tr&gt;
        &lt;tr&gt;
       <xsl:for-each select="rss:item">
           <xsl:variable name="desc" select="rss:description"/>
           <xsl:if test="substring($desc,1,2)='20'">
               <xsl:variable name="date" select="substring-before($desc,' ')"/>
                  
               <xsl:if test="contains($desc,'Tide')">
                   &lt;/tr&gt;&lt;tr&gt;&lt;td&gt;<xsl:value-of select="$date" disable-output-escaping="yes"/>&lt;/td&gt;
                   &lt;td&gt;<xsl:value-of select="substring-before(substring-after($desc,'at '),': ')" disable-output-escaping="yes"/>&lt;/td&gt;
                   &lt;td&gt;<xsl:value-of select="substring(substring-after($desc,'feet '),1,4)" disable-output-escaping="yes"/>&lt;/td&gt;
                   &lt;td&gt;<xsl:value-of select="substring-before(substring-after($desc,'T: '),'feet')" disable-output-escaping="yes"/> feet &lt;/td&gt;
                </xsl:if>
               
                <xsl:if test="(contains($desc,'Sun'))">
                    &lt;td&gt;<xsl:value-of select="substring-before(substring-after($desc,'at '),':')" disable-output-escaping="yes"/>&lt;/td&gt;
                    &lt;td&gt;<xsl:value-of select="substring-after($desc,'T: ')" disable-output-escaping="yes"/>&lt;/td&gt;
                   
                </xsl:if>
               
            </xsl:if>
       </xsl:for-each>
       &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;
    </xsl:template>
</xsl:stylesheet>

 
New Post
6/24/2008 4:35 PM
 

From what I can tell, you are actually coding literal characters.  Try just using straight HTML tags in the xsl, it is allowed.  I changed those literals to the HTML tags and it works.  Though, you'll have a lot of work to do with the actual layout, it doesn't display very well.

See if that helps.

 
New Post
6/24/2008 4:45 PM
 

I tried the actual HTML first, and I kept getting errors with my </tr> tags.  Maybe I have to put them somewhere besides the beginning of a line.  I'll try again.

I'm sure the layout is poor, as I hadn't been able to "see" it yet.  If you're really feeling helpful, you can help me with the syntax of "previous-sibling" so I can detect the date change.  I would have never discovered the <xsl:for-each select="rss:item"> if it hadn't been for your example.  Why "rss:" is at the beginning is a mystery I'll accept.

<xsl:if test="$date ! = substring-before(preceding-sibling::rss:item[1]/description,' ')"> seems like the natural extrapolation, but it rejects it.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsHTML tags not effective?HTML tags not effective?


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