htmlview.xslt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  15. xmlns:java="java:com.cognos.portal.utils.CCLLocaleUtils" exclude-result-prefixes="java xts">
  16. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  17. <!-- Set up the locale to use, either the CCL determined locale or the server locale -->
  18. <xsl:variable name="setUseLangAsDefault">
  19. <xsl:choose>
  20. <xsl:when test="root/customs/param[@name='HTMLMarkup']/value">
  21. <xsl:variable name="langs">
  22. <xsl:for-each select="/root/customs/param[@name='HTMLMarkup']/value">
  23. <xsl:value-of select="@xml:lang"/>
  24. <xsl:if test="not(position() = last())">,</xsl:if>
  25. </xsl:for-each>
  26. </xsl:variable>
  27. <xsl:value-of select="java:getBestFitLocale(string(/root/preferences/param[@name='contentLocale']),string($langs))"/>
  28. </xsl:when>
  29. </xsl:choose>
  30. </xsl:variable>
  31. <xsl:template match="/">
  32. <!-- Display the matched locale markup if there is one but if no match is found then use the first entry otherwise display the default edit to customize message -->
  33. <xsl:choose>
  34. <xsl:when test="string(root/customs/param[@name='HTMLMarkup']/value[@xml:lang=$setUseLangAsDefault])!=''">
  35. <div width="100%">
  36. <xsl:value-of select="/root/customs/param[@name='HTMLMarkup']/value[@xml:lang=$setUseLangAsDefault]" disable-output-escaping="yes"/>
  37. </div>
  38. </xsl:when>
  39. <xsl:when test="string(/root/customs/param[@name='HTMLMarkup']/value[1])!=''">
  40. <div width="100%">
  41. <xsl:value-of select="/root/customs/param[@name='HTMLMarkup']/value[1]" disable-output-escaping="yes"/>
  42. </div>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  46. <tr>
  47. <td class="portlet-font" align="center" valign="middle" height="100"><xts:string id="IDS_VEW_EDIT_TO_CUSTOMIZE"/></td>
  48. </tr>
  49. </table>
  50. </xsl:otherwise>
  51. </xsl:choose>
  52. </xsl:template>
  53. </xsl:stylesheet>