Blog Home  Home Feed your aggregator (RSS 2.0)  
My DasBlog! - XMLXSLAndXSLT
newtelligence powered
 
# Tuesday, April 25, 2006

We are currently working on a project were we are using Community Server and CMS. Users are able to post a message which is stored in Community Server and connected to an article inside CMS. It is also possible to use an RSS feed.

One of the tags inside the RSS feed contained html tags. This is content from a html editor control during the posting. The problem we got was that the html tags were displayed as normal text in stead of incorparated into the generated html.

The following modification (see bold) was needed to incorporate the html inside the field "description" in the html page using XSL.

<xsl:stylesheet>
   <xsl:output method="html"  />
   <xsl:template match="/">
      <xsl:for-each select="rss/channel/item">
         <div class="reactie-oneven">
         <table width="100%" border="0" cellpadding="0" cellspacing="0">
         <tr>
            <td></td>
            <td width="100%">
               <div class="content-brood">
               <strong>Door <span class="content-reacties-auteur">
               <xsl:value-of select="dc:creator" /></span> op 
               <span class="content-reacties-datum">
               <xsl:value-of select="pubDate" /></span></strong><br></br>
               <xsl:value-of select="description" disable-output-escaping="yes"/>
               </div>
            </td>
         </tr>
         </table>
         </div>
      </xsl:for-each>
   </xsl:template>
</xsl:stylesheet>

The actual xml looks like:

<rss>
   <channel>
      <item>
         <title>Reactie op Yes</title>
         <link>http://test.yes.nl/yescafe/forums/22/ShowForum.aspx</link>
         
<description>&lt;P&gt;...&lt;/P&gt;</description>
      </item>
   </channel>
</rss>

More information can be found in a knowledge base article of microsoft

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q264665

 

Tuesday, April 25, 2006 1:38:13 PM (GMT Daylight Time, UTC+01:00)  #    Comments [5]   XML, XSL and XSLT  | 
Copyright © 2012 Alexander Meijers. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: