home *** CD-ROM | disk | FTP | other *** search
- <?xml version='1.0'?>
- <!-- Style RSS so that it is readable. -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns:MSFT="http://www.microsoft.com"
- xmlns:msxsl="urn:schemas-microsoft-com:xslt"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:rss1="http://purl.org/rss/1.0/"
- xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- exclude-result-prefixes="MSFT msxsl rdf rss1 rss09 dc">
-
- <xsl:param name="locked" select="'no'" />
-
- <msxsl:script language="VBScript" implements-prefix="MSFT">
- <![CDATA[
- Function stripChars(xml, textlength)
- fullString = xml.nextNode.text
- fullString=Replace(fullString, Chr(10), "")
- fullString=Replace(fullString, """", "")
- fullString=Replace(fullString, "'", "")
-
- Set RegularExpressionObject = New RegExp
- With RegularExpressionObject
- .IgnoreCase = True
- .Global = True
- End With
-
- '' Need to delete the SCRIPT tags first
- RegularExpressionObject.Pattern = "<\s*script(?:.*?)/script\s*>"
- Set expressionMatch = RegularExpressionObject.Execute(fullString)
- If Not (expressionMatch.Count = 0) Then
- maxMatch = expressionMatch.Count
- For matchLoop = maxMatch-1 to 0 Step-1
- Set expressionMatched = expressionMatch(matchLoop)
- fullString = Left(fullString, expressionMatched.FirstIndex) & " " & Mid(fullString, expressionMatched.FirstIndex + expressionMatched.Length + 1)
- Next
- End If
-
- '' Now everything else.
- RegularExpressionObject.Pattern = "(</?([^!][a-zA-Z0-9]*)\s*(?:.*?)>)"
- Set expressionMatch = RegularExpressionObject.Execute(fullString)
- If Not (expressionMatch.Count = 0) Then
- maxMatch = expressionMatch.Count
- For matchLoop = maxMatch-1 to 0 Step-1
- Set expressionMatched = expressionMatch(matchLoop)
- thisTag = expressionMatched.SubMatches(1)
- fullString = Left(fullString, expressionMatched.FirstIndex) & " " & Mid(fullString, expressionMatched.FirstIndex + expressionMatched.Length + 1)
- Next
- End If
-
- Set RegularExpressionObject = nothing
-
- If Len(fullString) > textLength Then
- fullString=Left(fullString, textlength) & "..."
- End If
-
- If Trim(fullString) = "" Then
- fullString = "There is no further information."
- End If
-
- stripChars = fullString
- End Function
-
- Function safeUrl(link)
-
- url = link.nextNode.text
-
- url = Replace(url, "<", "")
- url = Replace(url, ">", "")
- url = Replace(url, """", "")
- url = Replace(url, "'", "")
- url = Replace(url, ";", "")
- url = Replace(url, "(", "")
- url = Replace(url, ")", "")
-
- safeUrl = url
- End Function
- ]]>
- </msxsl:script>
-
- <xsl:template match="/">
- <xsl:apply-templates select="/rss | /rdf:RDF" />
- </xsl:template>
-
- <xsl:template match='rss | rdf:RDF'>
- <xsl:variable name="rssversion" select="@version" />
- <div class="rssContainer">
- <span class="rssImage" id="rssImage"><img id="rssDummyImage" align="absmiddle" src="GIF/BLANK_GIF" onload="setRssTransparency()" /></span>
- <div class="rssUpdatedContainer"><xsl:if test="channel/pubDate != ''">Updated: <xsl:value-of select="channel/pubDate" /></xsl:if> </div>
- <xsl:if test="rss1:channel/dc:rights != ''">
- <div onmouseout="hideCopyright();" class="rssCopyrightContainer">
- <xsl:attribute name="onmouseover">doCopyright(event, '<xsl:value-of select="rss1:channel/dc:rights" />');</xsl:attribute>
- <xsl:value-of select="rss1:channel/dc:rights" />
- </div>
- </xsl:if>
- <xsl:if test="channel/copyright != ''">
- <div onmouseout="hideCopyright();" class="rssCopyrightContainer">
- <xsl:attribute name="onmouseover">doCopyright(event, '<xsl:value-of select="channel/copyright" />');</xsl:attribute>
- <xsl:value-of select="channel/copyright" />
- </div>
- </xsl:if>
- <div>
- <xsl:attribute name="class">
- <xsl:choose>
- <xsl:when test="(channel/copyright='' or not(channel/copyright)) and (rss1:channel/dc:rights='' or not(rss1:channel/dc:rights))">rssHeader</xsl:when>
- <xsl:otherwise>rssHeaderC</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:value-of select="channel/title" /><xsl:value-of select="rss1:channel/rss1:title" /><xsl:value-of select="rss09:channel/rss09:title" /></div>
- <div class="rssLinkContainer">
- <ul class="rssLinkList">
- <xsl:apply-templates select="channel/item[position() < 11] | rss1:item[position() < 11] | rss09:item[position() < 11]" mode="decide" />
- </ul>
- <div id="tooltip" style="display:none;"></div>
- </div>
- <div id="copyrighttooltip" style="display:none;"></div>
- </div>
- </xsl:template>
-
- <xsl:template match="item | rss1:item | rss09:item" mode="decide">
- <xsl:variable name="link"><xsl:value-of select="link" /><xsl:value-of select="rss1:link" /><xsl:value-of select="rss09:link" /></xsl:variable>
- <xsl:variable name="description"><xsl:value-of select="description" /><xsl:value-of select="rss1:description" /><xsl:value-of select="rss09:description" /></xsl:variable>
- <xsl:variable name="title"><xsl:value-of select="title" /><xsl:value-of select="rss1:title" /><xsl:value-of select="rss09:title" /></xsl:variable>
- <li class="rssLinkList">
- <xsl:choose>
- <xsl:when test="$locked='yes' or $link=''">
- <span onmouseout="hideTooltip();" class="rssLinkList">
- <xsl:apply-templates select="." mode="details">
- <xsl:with-param name="link" select="$link" />
- <xsl:with-param name="description" select="$description" />
- <xsl:with-param name="title" select="$title" />
- </xsl:apply-templates>
- </span>
- </xsl:when>
- <xsl:otherwise>
- <a onmouseout="hideTooltip();" class="rssLinkList">
- <xsl:attribute name="href">javascript:LaunchUrl('<xsl:value-of select="MSFT:safeUrl($link)" />');</xsl:attribute>
- <xsl:apply-templates select="." mode="details">
- <xsl:with-param name="link" select="$link" />
- <xsl:with-param name="description" select="$description" />
- <xsl:with-param name="title" select="$title" />
- </xsl:apply-templates>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </li>
- </xsl:template>
-
- <xsl:template match="item | rss1:item | rss09:item" mode="details">
- <xsl:param name="link" />
- <xsl:param name="description" />
- <xsl:param name="title" />
- <xsl:if test="$description">
- <xsl:attribute name="onmouseover">doTooltip(event, '<xsl:value-of select="MSFT:stripChars($description, 500)" />');</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$title='' or not($title)"><xsl:value-of select="MSFT:stripChars($description, 50)" /></xsl:when>
- <xsl:otherwise><xsl:value-of select='$title'/></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- </xsl:stylesheet>