view.xslt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  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. <!-- $Header: //cpscrn/main/templates/cps4/portlets/utility/portlet-impl/rss/view.xslt#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  18. xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/"
  19. xmlns:rss10="http://purl.org/rss/1.0/"
  20. xmlns:atom="http://www.w3.org/2005/Atom"
  21. xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
  22. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  23. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  24. xmlns:string="java:java.lang.String"
  25. exclude-result-prefixes="rdf rss09 rss10 atom ui xts xtsext string">
  26. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  27. <xsl:attribute-set name="anchor">
  28. <xsl:attribute name="class">cognos-anchor</xsl:attribute>
  29. <xsl:attribute name="onmouseover">window.status='';return true;</xsl:attribute>
  30. <xsl:attribute name="onmouseout">window.status='';return true;</xsl:attribute>
  31. </xsl:attribute-set>
  32. <ui:property name="target-frame" select="'target'"/>
  33. <xsl:attribute-set name="target">
  34. <xsl:attribute name="target">
  35. <xsl:choose>
  36. <xsl:when test="$open-links = 'new'">_blank</xsl:when>
  37. <xsl:when test="$open-links = 'current' and not($ui-is-myportal)">_top</xsl:when>
  38. <xsl:when test="$open-links = 'target'"><xsl:value-of select="$target-frame"/></xsl:when>
  39. <xsl:when test="$open-links = 'channel'"></xsl:when>
  40. <xsl:otherwise>_blank</xsl:otherwise>
  41. </xsl:choose>
  42. </xsl:attribute>
  43. </xsl:attribute-set>
  44. <ui:property name="rss-entries" select="'rss_entries'"/>
  45. <ui:property name="rss-prefs" select="'rss_entries'" exclude-nav-state="'true'"/>
  46. <ui:property name="rss-show-desc" select="'rss_show_desc'"/>
  47. <ui:property name="rss-show-image" select="'rss_show_image'"/>
  48. <ui:property name="rss-alternate" select="'rss_alternate'"/>
  49. <ui:property name="open-links" select="'open_links'"/>
  50. <ui:property name="channel" select="'channel'"/>
  51. <xsl:variable name="rss-disable-escaping" select="/root/configuration/property[@name='CPSRssAllowUnsafeCharacters'] = 'true'"/>
  52. <xsl:variable name="valid-link-expr">(([hH][tT][tT][pP][sS]?)://(\S+))|(.{0})</xsl:variable>
  53. <xsl:template match="/">
  54. <xsl:choose>
  55. <xsl:when test="/root/rss/*[local-name()='channel'] | /root/rdf:RDF/*[local-name()='channel'] | /root/atom:feed">
  56. <xsl:call-template name="render-rss"/>
  57. </xsl:when>
  58. <xsl:otherwise>
  59. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  60. <tr>
  61. <td class="portlet-font" align="center" valign="middle" height="100"><xts:string id="IDS_UTI_RSS_NO_CONTENT"/></td>
  62. </tr>
  63. </table>
  64. </xsl:otherwise>
  65. </xsl:choose>
  66. <ui:preview/>
  67. </xsl:template>
  68. <xsl:template name="render-rss">
  69. <script language="javascript">
  70. function wsrp_rewrite_select(href,e) {
  71. <xsl:if test="$open-links = 'channel'">
  72. document.wsrp_rewrite_form.url.value = href;
  73. document.wsrp_rewrite_form.submit();
  74. if (e.srcElement) {
  75. e.returnValue = false;
  76. } else {
  77. e.preventDefault();
  78. }
  79. </xsl:if>
  80. }
  81. </script>
  82. <xsl:if test="$rss-show-desc = 'true'">
  83. <style>
  84. .wsrp_rewrite_border
  85. {
  86. border-top: black 1px solid;
  87. border-left: black 1px solid;
  88. border-bottom: black 1px solid;
  89. border-right: black 1px solid;
  90. display:none;
  91. width:100%;
  92. }
  93. .wsrp_rewrite_padding {
  94. padding: 3px 3px 3px 3px;
  95. }
  96. .wsrp_rewrite_anim
  97. {
  98. padding: 0px 0px 0px 0px;
  99. border-top: black 1px solid;
  100. border-left: black 1px solid;
  101. border-bottom: black 1px solid;
  102. border-right: black 1px solid;
  103. display:none;
  104. position:absolute;
  105. }
  106. </style>
  107. <script language="javascript">
  108. <![CDATA[
  109. var wsrp_rewrite_rss_height=0;
  110. var wsrp_rewrite_rss_div=null;
  111. var wsrp_rewrite_rss_sid="";
  112. function wsrp_rewrite_rss_start(id) {
  113. if (wsrp_rewrite_rss_div != null) {
  114. wsrp_rewrite_rss_div.style.display="none";
  115. }
  116. wsrp_rewrite_rss_div=document.getElementById(id);
  117. wsrp_rewrite_rss_div.style.visibility="hidden";
  118. wsrp_rewrite_rss_div.style.display="block";
  119. var ga=document.getElementById("wsrp_rewrite_anim");
  120. var p = wsrp_rewrite_rss_div.offsetParent;
  121. var x = 0;
  122. var y = 0;
  123. while (p != null) {
  124. x += p.offsetLeft;
  125. y += p.offsetTop;
  126. p = p.offsetParent;
  127. }
  128. ga.style.left = wsrp_rewrite_rss_div.offsetLeft + x;
  129. ga.style.top = wsrp_rewrite_rss_div.offsetTop + y;
  130. ga.style.width = wsrp_rewrite_rss_div.offsetWidth;
  131. ga.style.height = 0;
  132. ga.style.display = "inline";
  133. wsrp_rewrite_rss_height = 0;
  134. wsrp_rewrite_rss_sid = window.setInterval(wsrp_rewrite_rss_anim, 10);
  135. }
  136. function wsrp_rewrite_rss_anim(sID) {
  137. var ga=document.getElementById("wsrp_rewrite_anim");
  138. if (wsrp_rewrite_rss_height < wsrp_rewrite_rss_div.offsetHeight) {
  139. ga.style.height = wsrp_rewrite_rss_height;
  140. wsrp_rewrite_rss_height += (wsrp_rewrite_rss_div.offsetHeight / 25);
  141. } else {
  142. wsrp_rewrite_rss_div.style.visibility="inherit";
  143. ga.style.display="none";
  144. window.clearInterval(wsrp_rewrite_rss_sid);
  145. }
  146. }
  147. ]]>
  148. </script>
  149. <div id="wsrp_rewrite_anim" class="portlet-font wsrp_rewrite_anim"><br/></div>
  150. </xsl:if>
  151. <xsl:choose>
  152. <xsl:when test="$open-links = 'channel'">
  153. <form name="wsrp_rewrite_form" method="post" action="wsrp_rewrite?wsrp-urlType=blockingAction&amp;wsrp-interactionState=set:{ $channel }&amp;wsrp-windowState={ $ui-window-state }/wsrp_rewrite">
  154. <input type="hidden" name="url" value=""/>
  155. <input type="hidden" name="rss_entries" value="{ $rss-entries }"/>
  156. <xsl:apply-templates select="/root/rss | /root/rdf:RDF | /root/atom:feed"/>
  157. </form>
  158. </xsl:when>
  159. <xsl:otherwise>
  160. <xsl:apply-templates select="/root/rss | /root/rdf:RDF | /root/atom:feed"/>
  161. </xsl:otherwise>
  162. </xsl:choose>
  163. </xsl:template>
  164. <xsl:template match="rss|rdf:RDF">
  165. <script type="text/javascript">
  166. <xsl:attribute name="src">
  167. <xsl:value-of select="$ui-webcontent"/>/../ccl/i18n/bidi/BidiUtils.js<xsl:text/>
  168. </xsl:attribute>
  169. </script>
  170. <script language="javascript">
  171. function wsrp_rewrite_setRSSTableDirection()
  172. {
  173. var isBidiEnabled = <xsl:value-of select="boolean($ui-portlet-isBidiEnabled='true')"/>;
  174. if (isBidiEnabled){
  175. var el = document.getElementById("wsrp_rewrite_RSSTable");
  176. if (el)
  177. {
  178. var baseTextDirection = '<xsl:value-of select="$ui-portlet-baseTextDirection"/>';
  179. if (baseTextDirection == "auto")
  180. {
  181. var bidi = BidiUtils.getInstance();
  182. bidi.setProperties(baseTextDirection,
  183. '<xsl:value-of select="xtsext:getBTD('', $ui-portlet-baseTextDirection, $ui-portlet-product-locale)"/>',
  184. '<xsl:value-of select="$ui-portlet-product-locale"/>');
  185. var txtContent = el.textContent || el.innerText;
  186. baseTextDirection = bidi.resolveStrBtd(txtContent);
  187. }
  188. el.dir = baseTextDirection;
  189. }
  190. }
  191. }
  192. if (window.attachEvent) {
  193. window.attachEvent("onload", wsrp_rewrite_setRSSTableDirection);
  194. } else if (window.addEventListener) {
  195. window.addEventListener("load", wsrp_rewrite_setRSSTableDirection, null);
  196. }
  197. </script>
  198. <table id="wsrp_rewrite_RSSTable" border="0" cellpadding="0" cellspacing="0" width="100%">
  199. <xsl:apply-templates select="channel|rss09:channel|rss10:channel|atom:feed"/>
  200. <xsl:apply-templates select="textinput|rss09:textinput|rss10:textinput"/>
  201. </table>
  202. </xsl:template>
  203. <xsl:template match="atom:feed">
  204. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  205. <xsl:call-template name="render-feed-content"/>
  206. </table>
  207. </xsl:template>
  208. <xsl:template match="channel" name="render-feed-content">
  209. <xsl:variable name="description" select="concat(description, atom:subtitle)"/>
  210. <tr>
  211. <td class="portlet-font">
  212. <xsl:variable name="url">
  213. <xsl:call-template name="create-link">
  214. <xsl:with-param name="link" select="link|atom:link[@rel='alternate' and @type='text/html']/@href"/>
  215. </xsl:call-template>
  216. </xsl:variable>
  217. <a xsl:use-attribute-sets="anchor target">
  218. <xsl:if test="$url != ''">
  219. <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute>
  220. <xsl:attribute name="onclick">
  221. <xsl:text>wsrp_rewrite_select('</xsl:text>
  222. <xsl:value-of select="xtsext:javascriptencode( string($url))"/>
  223. <xsl:text>',event)</xsl:text>
  224. </xsl:attribute>
  225. </xsl:if>
  226. <xsl:if test="$rss-show-image = 'true'">
  227. <xsl:variable name="image-url">
  228. <xsl:choose>
  229. <xsl:when test="*[local-name() = 'image']">
  230. <xsl:value-of select="*[local-name() = 'image']/*[local-name() = 'url']"/>
  231. </xsl:when>
  232. <xsl:when test="atom:icon">
  233. <xsl:value-of select="atom:icon"/>
  234. </xsl:when>
  235. <xsl:otherwise>
  236. <xsl:value-of select="../*[local-name() = 'image'][1]/*[local-name() = 'url']"/>
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. </xsl:variable>
  240. <xsl:if test="$image-url != ''">
  241. <img border="0" src="{ $image-url }" style="float:right;"/>
  242. </xsl:if>
  243. </xsl:if>
  244. <b>
  245. <xsl:apply-templates select="title|atom:title" mode="rss-markup"/>
  246. </b>
  247. </a>
  248. <xsl:if test="$rss-show-desc = 'true' and $description != ''">
  249. <br/>
  250. <xsl:value-of select="$description"/>
  251. <xsl:if test="concat(copyright, atom:rights)!=''">
  252. <br/>
  253. <xsl:value-of select="concat(copyright, atom:rights)"/>
  254. </xsl:if>
  255. </xsl:if>
  256. </td>
  257. </tr>
  258. <xsl:variable name="rss-entries-value">
  259. <xsl:call-template name="cal-rss-entries-value">
  260. <xsl:with-param name="count" select="count(item|atom:entry)"/>
  261. </xsl:call-template>
  262. </xsl:variable>
  263. <xsl:apply-templates select="item[number($rss-entries-value)&gt;=position()] | atom:entry[number($rss-entries-value)&gt;=position()]"/>
  264. <xsl:call-template name="generate-footer">
  265. <xsl:with-param name="count" select="count(item|atom:entry)"/>
  266. </xsl:call-template>
  267. </xsl:template>
  268. <xsl:template match="rss09:channel">
  269. <xsl:variable name="description" select="rss09:description"/>
  270. <xsl:if test="$description != ''">
  271. <tr>
  272. <td class="portlet-table-header">
  273. <b>
  274. <xsl:value-of select="$description"/>
  275. </b>
  276. </td>
  277. </tr>
  278. </xsl:if>
  279. <xsl:variable name="rss-entries-value">
  280. <xsl:call-template name="cal-rss-entries-value">
  281. <xsl:with-param name="count" select="count(../rss09:item)"/>
  282. </xsl:call-template>
  283. </xsl:variable>
  284. <xsl:apply-templates select="../rss09:item[$rss-entries-value&gt;=position()]"/>
  285. <xsl:call-template name="generate-footer">
  286. <xsl:with-param name="count" select="count(../rss09:item)"/>
  287. </xsl:call-template>
  288. </xsl:template>
  289. <xsl:template match="rss10:channel">
  290. <xsl:variable name="description" select="rss10:description"/>
  291. <tr>
  292. <td class="portlet-table-header">
  293. <xsl:variable name="url">
  294. <xsl:call-template name="create-link">
  295. <xsl:with-param name="link" select="rss10:link"/>
  296. </xsl:call-template>
  297. </xsl:variable>
  298. <a xsl:use-attribute-sets="anchor target">
  299. <xsl:if test="$url != ''">
  300. <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute>
  301. <xsl:attribute name="onclick">
  302. <xsl:text>wsrp_rewrite_select('</xsl:text>
  303. <xsl:value-of select="xtsext:javascriptencode( string($url))"/>
  304. <xsl:text>',event)</xsl:text>
  305. </xsl:attribute>
  306. </xsl:if>
  307. <b>
  308. <xsl:value-of select="rss10:title"/>
  309. </b>
  310. </a>
  311. <xsl:if test="$rss-show-desc = 'true' and $description != ''">
  312. <br/>
  313. <xsl:value-of select="$description"/>
  314. </xsl:if>
  315. </td>
  316. </tr>
  317. <xsl:variable name="rss-entries-value">
  318. <xsl:call-template name="cal-rss-entries-value">
  319. <xsl:with-param name="count" select="count(../rss10:item)"/>
  320. </xsl:call-template>
  321. </xsl:variable>
  322. <xsl:apply-templates select="../rss10:item[$rss-entries-value&gt;=position()]"/>
  323. <xsl:call-template name="generate-footer">
  324. <xsl:with-param name="count" select="count(../rss10:item)"/>
  325. </xsl:call-template>
  326. </xsl:template>
  327. <xsl:template match="item|rss09:item|rss10:item|atom:entry">
  328. <xsl:variable name="description">
  329. <xsl:choose>
  330. <xsl:when test="*[local-name() = 'description']"><xsl:copy-of select="*[local-name() = 'description']"/></xsl:when>
  331. <xsl:when test="atom:content[contains(@type, 'text') or contains(@type, 'html')]">
  332. <xsl:copy-of select="atom:content"/>
  333. </xsl:when>
  334. <xsl:when test="atom:summary"><xsl:copy-of select="atom:summary"/></xsl:when>
  335. </xsl:choose>
  336. </xsl:variable>
  337. <tr>
  338. <td class="portlet-table-text">
  339. <xsl:attribute name="class">
  340. <xsl:choose>
  341. <xsl:when test="position() mod 2 = 0 and $rss-alternate = 'true'">portlet-table-alternate</xsl:when>
  342. <xsl:otherwise>portlet-table-text</xsl:otherwise>
  343. </xsl:choose>
  344. </xsl:attribute>
  345. <xsl:variable name="author">
  346. <xsl:choose>
  347. <xsl:when test="atom:contributor/atom:name">
  348. <xsl:value-of select="atom:contributor/atom:name"/>
  349. </xsl:when>
  350. <xsl:otherwise>
  351. <xsl:value-of select="*[local-name()='author' or local-name()='creator' and .!=''][1]"/>
  352. </xsl:otherwise>
  353. </xsl:choose>
  354. </xsl:variable>
  355. <xsl:choose>
  356. <xsl:when test="$author != ''">
  357. <xsl:text/><xts:string id="IDS_UTI_RSS_TITLE_BY"><xts:param name="title"><xsl:call-template name="render-link"/></xts:param><xts:param name="author"><xsl:value-of select="$author"/></xts:param></xts:string>
  358. </xsl:when>
  359. <xsl:otherwise>
  360. <xsl:call-template name="render-link"/>
  361. </xsl:otherwise>
  362. </xsl:choose>
  363. <xsl:if test="($rss-show-desc = 'true')">
  364. <br/>
  365. <div id="wsrp_rewrite_{generate-id()}" class="wsrp_rewrite_border">
  366. <div class="portlet-font wsrp_rewrite_padding">
  367. <xsl:if test="*[local-name() = 'link']">
  368. <xsl:variable name="url">
  369. <xsl:call-template name="create-link">
  370. <xsl:with-param name="link" select="atom:link[@rel='alternate' and @type='text/html']/@href | *[local-name() = 'link' and namespace-uri() != 'http://www.w3.org/2005/Atom']"/>
  371. </xsl:call-template>
  372. </xsl:variable>
  373. <xsl:if test=" $url != ''">
  374. <a xsl:use-attribute-sets="anchor target" href="{ $url }" onclick="wsrp_rewrite_select('{ xtsext:javascriptencode(string($url)) }',event)"><xts:string id="IDS_UTI_RSS_READ_FEED"/></a><br/>
  375. </xsl:if>
  376. </xsl:if>
  377. <xsl:apply-templates select="$description" mode="rss-markup"/>
  378. </div>
  379. </div>
  380. </xsl:if>
  381. </td>
  382. </tr>
  383. </xsl:template>
  384. <xsl:template name="render-link">
  385. <xsl:variable name="url">
  386. <xsl:call-template name="create-link">
  387. <xsl:with-param name="link" select="atom:link[@rel='alternate' and @type='text/html']/@href | *[local-name() = 'link' and namespace-uri() != 'http://www.w3.org/2005/Atom']"/>
  388. </xsl:call-template>
  389. </xsl:variable>
  390. <xsl:choose>
  391. <xsl:when test="$rss-show-desc = 'true'">
  392. <a xsl:use-attribute-sets="anchor" href="javascript:wsrp_rewrite_rss_start('wsrp_rewrite_{generate-id()}')">
  393. <xsl:apply-templates select="*[local-name() = 'title']" mode="rss-markup"/>
  394. </a>
  395. </xsl:when>
  396. <xsl:when test="not(*[local-name() = 'link'])">
  397. <xsl:apply-templates select="*[local-name() = 'title']" mode="rss-markup"/>
  398. </xsl:when>
  399. <xsl:when test=" $url != '' ">
  400. <a xsl:use-attribute-sets="anchor target" href="{ $url }" onclick="wsrp_rewrite_select('{ xtsext:javascriptencode(string($url)) }',event)">
  401. <xsl:apply-templates select="*[local-name() = 'title']" mode="rss-markup"/>
  402. </a>
  403. </xsl:when>
  404. <xsl:otherwise>
  405. <xsl:apply-templates select="*[local-name() = 'title']" mode="rss-markup"/>
  406. </xsl:otherwise>
  407. </xsl:choose>
  408. </xsl:template>
  409. <xsl:template match="textinput|rss09:textinput|rss10:textinput">
  410. <tr>
  411. <td class="portlet-form-text">
  412. <form name="wsrp_rewrite_{ generate-id() }" method="get" action="{ normalize-space(*[local-name() = 'link']) }" target="_blank">
  413. <br/>
  414. <xsl:value-of select="*[local-name() = 'description']"/>
  415. <br/>
  416. <input class="portlet-form-input-field" type="text" name="{*[local-name() = 'name']}" value=""/>
  417. <xsl:text>&#160;</xsl:text>
  418. <input class="portlet-form-button" type="submit" name="submit" value="{*[local-name() = 'title']}"/>
  419. </form>
  420. </td>
  421. </tr>
  422. </xsl:template>
  423. <!-- We ignore images unless we are inside a channel -->
  424. <xsl:template match="rss09:image | rss10:image"/>
  425. <xsl:template name="generate-footer">
  426. <xsl:param name="count"/>
  427. <xsl:variable name="rss-entries-value">
  428. <xsl:call-template name="cal-rss-entries-value">
  429. <xsl:with-param name="count" select="$count"/>
  430. </xsl:call-template>
  431. </xsl:variable>
  432. <xsl:choose>
  433. <xsl:when test="number($count)&gt;number($rss-entries-value)">
  434. <tr>
  435. <td class="portlet-font" align="center">
  436. <br/>
  437. <ui:create-nav-state name="state">
  438. <ui:param name="rss_entries">
  439. <xsl:value-of select="$count"/>
  440. </ui:param>
  441. </ui:create-nav-state>
  442. <a xsl:use-attribute-sets="anchor" href="wsrp_rewrite?wsrp-urlType=render&amp;wsrp-navigationalState={xtsext:urlencode($state)}/wsrp_rewrite"><xts:string id="IDS_UTI_RSS_LINK_DISPLAY_ALL"/></a>
  443. </td>
  444. </tr>
  445. </xsl:when>
  446. <xsl:when test="number($rss-entries-value)&gt;number($rss-prefs)">
  447. <tr>
  448. <td class="portlet-font" align="center">
  449. <br/>
  450. <ui:create-nav-state name="state">
  451. <ui:param name="rss_entries">
  452. <xsl:value-of select="$rss-prefs"/>
  453. </ui:param>
  454. </ui:create-nav-state>
  455. <a xsl:use-attribute-sets="anchor" href="wsrp_rewrite?wsrp-urlType=render&amp;wsrp-navigationalState={xtsext:urlencode($state)}/wsrp_rewrite"><xts:string id="IDS_UTI_RSS_LINK_DISPLAY_PARTIAL"><xts:param name="count"><xsl:value-of select="$rss-prefs"/></xts:param></xts:string></a>
  456. </td>
  457. </tr>
  458. </xsl:when>
  459. </xsl:choose>
  460. </xsl:template>
  461. <xsl:template name="cal-rss-entries-value">
  462. <xsl:param name="count"/>
  463. <xsl:choose>
  464. <xsl:when test="number($count)&gt;number($rss-entries) and number($rss-prefs) != number($rss-entries)">
  465. <xsl:value-of select="$rss-prefs"/>
  466. </xsl:when>
  467. <xsl:otherwise>
  468. <xsl:value-of select="$rss-entries"/>
  469. </xsl:otherwise>
  470. </xsl:choose>
  471. </xsl:template>
  472. <xsl:template match="*" mode="rss-markup">
  473. <xsl:choose>
  474. <xsl:when test="$rss-disable-escaping">
  475. <xsl:value-of select="." disable-output-escaping="yes"/>
  476. </xsl:when>
  477. <xsl:when test="*">
  478. <xsl:copy-of select="."/>
  479. </xsl:when>
  480. <xsl:otherwise>
  481. <xsl:value-of select="."/>
  482. </xsl:otherwise>
  483. </xsl:choose>
  484. </xsl:template>
  485. <xsl:template name="create-link">
  486. <xsl:param name="link"/>
  487. <xsl:if test="boolean(string:matches( string:new( normalize-space($link) ), $valid-link-expr ))">
  488. <xsl:value-of select="normalize-space($link)"/>
  489. </xsl:if>
  490. </xsl:template>
  491. </xsl:stylesheet>