Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9298551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:21:10+00:00 2026-06-18T22:21:10+00:00

I am styling an RSS feed but having an issue with the following part:

  • 0

I am styling an RSS feed but having an issue with the following part:

<description>
<![CDATA[
<img src="http://l.yimg.com/a/i/us/we/52/34.gif"/><br /> <b>Current Conditions:</b><br /> Fair, 73 F<BR /> <BR /><b>Forecast:</b><BR /> Sat - Clear. High: 78 Low: 62<br /> Sun - Mostly Sunny. High: 80 Low: 66<br /> <br /> <a href="http://us.rd.yahoo.com/dailynews/rss/weather/Dubai__AE/*http://weather.yahoo.com/forecast/AEXX0004_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/> (provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]>
</description>

You can see my attempt here

Here is my XSLT:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
  <head>
    <title></title>
  </head>
  <body>
    <table cellpadding="2" cellspacing="0" border="0" width="75%">
        <xsl:for-each select="rss/channel/item">

              <tr style="color:#0080FF;">
                <td style="text-align:left;font-weight:bold;">
                  <xsl:value-of select ="title"></xsl:value-of>
                </td>
                </tr>


                <tr style="color:#0080FF;">
                <td style="text-align:left;font-weight:bold;">
                  <xsl:value-of select ="location"></xsl:value-of>
                  <xsl:value-of select="pubDate"/>
                </td>
              </tr>


              <tr>
                <td colspan="2" style="text-align:left;padding-top:10px;">
                  <xsl:value-of select="description"/>
                </td>
              </tr>

          <tr>
            <td colspan="2" style="height:20px;">
              <hr></hr>
            </td>
          </tr>
        </xsl:for-each>
    </table>
  </body>
</html>
 </xsl:template>
</xsl:stylesheet>

I am trying to get the information from the description tag so I can style it like I did the title and publication date. Here is the full XML RSS feed which I am trying to style. Can anyone help me figure out why the CDATA tags are messing things up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:21:11+00:00Added an answer on June 18, 2026 at 10:21 pm

    Try not to use <xsl:for-each>. Code becomes more clearly arranged when you rely on <xsl:template> and <xsl:apply-templates>.

    Also try to use CSS classes and remove the inline style from the output HTML.

    If you output classic HTML (not XHTML) then tell the XSLT processor so by using <xsl:output> and also output a doctype.

    Your output problem will be solved by using disable-output-escaping="yes". Note that not every XSL processor supports that attribute. The ability to disable output escaping is optional as per the XSLT spec.

    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
      <xsl:output method="html" indent="yes" 
         doctype-system='http://www.w3.org/TR/html4/strict.dtd'
         doctype-public='-//W3C//DTD HTML 4.01//EN' 
      />
    
      <xsl:template match="/rss">
        <html>
          <head>
            <title></title>
          </head>
          <body>
            <xsl:apply-templates select="channel" />
          </body>
        </html>
      </xsl:template>
    
      <xsl:template match="channel">
        <table cellpadding="2" cellspacing="0" border="0" width="75%">
          <xsl:apply-templates select="item" />
        </table>
      </xsl:template>
    
      <xsl:template match="item">
        <!-- ... -->
        <tr>
          <td colspan="2" style="text-align:left;padding-top:10px;">
            <xsl:value-of select="description" disable-output-escaping="yes" />
          </td>
        </tr>
        <!-- ... -->
      </xsl:template>
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having 'issues' styling CSS with HTML5 placeholder in FF and Chrome. Example: http://jchmusic.com
I am having styling issue with products loaded in datalist control in Chrome. While
I have a twitter feed in the format: 1. Username: Blah blah http://something.com #hashtag
I am styling the messages in red for errors and green for success. But
I'm styling a form designed by a client with the following structure: <div class=formRow>
I use some CSS styling to hide input buttton, images and so on but
I've been trying to get styling working on site uncookedblog.com for hours now. I
There's been many questions on styling on action bars, but the ones I've found
I am having problems styling form fields with CSS. As you can see below
I am styling a Wordpress theme but has run into problem with IE7. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.