rssxsl.xts 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. This morphlet outputs a stylesheet that transforms an RSS 2.0 feed into a simple HTML presentation. If you want to make it look fancier,
  14. use the css file.
  15. This is meant to be referenced at the top of the RSS feed with an <?xml-stylesheet?> processing instruction like so:
  16. <?xml-stylesheet href="/cognos8/cgi-bin/(cognosgateway)?b_action=xts.run&m=portal/rssxsl.xts" type="text/xsl"?>
  17. This way, it is processed in the browser.
  18. I used a morphlet here instead of just a plain xslt file so that it can be skin and message-file sensitive.
  19. -->
  20. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  21. <xts:block id="one" type="exec" mode="interpret" processor="XSLT">
  22. <xts:logicsheet path="logicsheets/portal.xsl"/>
  23. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  24. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  25. <xsl:stylesheet version="1.0"
  26. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  27. xmlns:out="dummy-uri"
  28. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  29. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  30. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  31. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  32. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  33. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  34. exclude-result-prefixes="xsl xtsext xts pf df dp">
  35. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  36. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  37. <pf:variables/>
  38. <xsl:template match="/root">
  39. <xts:sequence>
  40. <xts:append select="/root/output">
  41. <xos:part>
  42. <xos:entityHeader>
  43. <xos:param name="Content-Type">text/xml; charset UTF-8</xos:param>
  44. </xos:entityHeader>
  45. <xos:entityBody>
  46. <out:stylesheet version="1.0">
  47. <out:output method="html" version="1.0" encoding="UTF-8"/>
  48. <out:template match="rss[@version='2.0']">
  49. <html>
  50. <head>
  51. <title><xts:string id="IDS_RSS_FEED_AVAILABLE"/></title>
  52. <link rel="stylesheet" type="text/css" href="{$skin_fonts}"/>
  53. <link rel="stylesheet" type="text/css" href="{$skin_style}"/>
  54. </head>
  55. <body>
  56. <table class="rss-header" cellspacing="0" cellpadding="0" width="100%" border="0">
  57. <tbody>
  58. <tr>
  59. <td width="95%" ><span class="rss-header-title" >&#160;<xts:string id="IDS_RSS_FEED_AVAILABLE"/></span></td>
  60. <td width="2%" valign="center" class="dialogHeaderLink">&#160;</td>
  61. <td width="3%" align="center" valign="middle"><a href="javascript:history.back()"><dp:closeMarker/></a></td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. <out:apply-templates select="channel"/>
  66. <dp:footer>
  67. <df:button df:id="IDS_CLOSE" df:style="href" df:href="javascript:history.back();"/>
  68. </dp:footer>
  69. <!-- These extra divs/spans may be used as catch-alls to add extra images to the page.
  70. I got this idea from http://www.csszengarden.com/ -->
  71. <div id="extraDiv1"><span></span></div><div id="extraDiv2"><span></span></div><div id="extraDiv3"><span></span></div>
  72. <div id="extraDiv4"><span></span></div><div id="extraDiv5"><span></span></div><div id="extraDiv6"><span></span></div>
  73. </body>
  74. </html>
  75. </out:template>
  76. <out:template match="channel">
  77. <br/>
  78. <table align="center" cellSpacing="0" width="90%" border="0">
  79. <tbody>
  80. <tr>
  81. <td width="10%" align="center" valign="middle" class="rssLeftPanel" ><img src="{$image_root}/icon_tip_48.gif"/></td>
  82. <td width="90%" valign="top" class="rssRightPanel">
  83. <p class="rss-desc"><xts:string id="IDS_RSSVIEW_INTRO_1"/><br/><br/><xts:string id="IDS_RSSVIEW_INTRO_2"/></p></td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <br/>
  88. <table width="90%" align="center" border="0" cellPadding="3px" cellSpacing="0">
  89. <tbody>
  90. <tr>
  91. <td colspan="2" class="rss-title" ><a href="{'{link}'}"><out:value-of select="title"/></a></td>
  92. </tr>
  93. <out:if test="description != ''">
  94. <tr>
  95. <td colspan="2" class="rss-desc" valign="top"><out:value-of select="description"/><br/></td>
  96. </tr>
  97. </out:if>
  98. <out:apply-templates select="item"/>
  99. </tbody>
  100. </table>
  101. </out:template>
  102. <out:template match="item">
  103. <tr>
  104. <td width="3%"></td>
  105. <td width="97%"><a class="rss-item-title" href="{'{link}'}"><out:value-of select="title"/></a></td>
  106. </tr>
  107. <tr>
  108. <td>&#160;</td>
  109. <td class="rss-desc"><out:value-of select="description"/></td>
  110. </tr>
  111. <tr>
  112. <td>&#160;</td>
  113. <td class="rss-desc" valign="top"><out:value-of select="pubDate"/></td>
  114. </tr>
  115. </out:template>
  116. </out:stylesheet>
  117. </xos:entityBody>
  118. </xos:part>
  119. </xts:append>
  120. </xts:sequence>
  121. </xsl:template>
  122. </xsl:stylesheet>
  123. </xts:block>
  124. </xts:morphlet>