misc.log

日常茶飯事とお仕事と

DNN、RSSフィード用のスタイルシート

サイト内のQ&A掲示板から、最新のものをピックアップするように設定してみた。

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>

<xsl:template match="rss/channel">

  <!-- Do not show channel image -->
  <xsl:for-each select="item">

   <xsl:if test="string(link) != string(guid)">
    <xsl:if test="position() < 15">

       <br>
       <strong><a href="{link}" target="_main"><xsl:value-of select="title"/></a></strong><br></br>

       <!-- only display markup for description if it&#39;s present -->
       <medium><xsl:value-of select="substring(description,1,50)"/></medium>
       </br>

    <br></br>

    </xsl:if>

   </xsl:if>
  </xsl:for-each>
</xsl:template>

<xsl:template match="description">
  <br>
    <xsl:value-of select="."/>
  </br>
</xsl:template>

あぁ、タグがそのまま...まぁいいや。

参考Web情報