pp2atom_chart.xsl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: CCS
  5. (c) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:cog8="http://developer.cognos.com/schemas/report/5.0/" xmlns:ccs="com.cognos.ccs.xslt.XSLTFunctions" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/">
  9. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
  10. <xsl:template match="/">
  11. <root>
  12. <xsl:if test="data/tab/crosstab/datarow/col[@src]">
  13. <xsl:call-template name="atomEntry">
  14. <xsl:with-param name="entryID">
  15. <xsl:value-of select="concat('c',position())"/>
  16. </xsl:with-param>
  17. <xsl:with-param name="entryType">chart</xsl:with-param>
  18. </xsl:call-template>
  19. <xsl:if test="data/tab/crosstab/datarow/col/area[@icon or @color]">
  20. <xsl:call-template name="atomEntry">
  21. <xsl:with-param name="entryID"><xsl:value-of select="concat('cl',position())"/></xsl:with-param>
  22. <xsl:with-param name="entryType">list</xsl:with-param>
  23. </xsl:call-template>
  24. </xsl:if>
  25. </xsl:if>
  26. </root>
  27. </xsl:template>
  28. <xsl:template match="*">
  29. <!--Unknown element. Ignore-->
  30. </xsl:template>
  31. <xsl:template name="atomEntry">
  32. <xsl:param name="entryID"/>
  33. <xsl:param name="entryIcon"/>
  34. <xsl:param name="entryType"/>
  35. <atom:entry>
  36. <atom:id>
  37. <xsl:choose>
  38. <xsl:when test="function-available('ccs:encodeID')">
  39. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',ccs:encodeID($entryID))"/>
  40. </xsl:when>
  41. <xsl:otherwise>
  42. <xsl:value-of select="concat('tag:cognos.com,2007:@report_id@/',$entryID)"/>
  43. </xsl:otherwise>
  44. </xsl:choose>
  45. </atom:id>
  46. <atom:title>
  47. <xsl:value-of select="$entryID"/>
  48. </atom:title>
  49. <atom:updated>@report_updated@</atom:updated>
  50. <atom:link>
  51. <xsl:attribute name="rel">icon</xsl:attribute>
  52. <xsl:attribute name="type">image/gif</xsl:attribute>
  53. <xsl:attribute name="href"><xsl:value-of select="concat('@webcontent_root@/ccs/images/', $entryType,'_icon.gif')"/></xsl:attribute>
  54. </atom:link>
  55. <atom:link>
  56. <xsl:attribute name="rel">alternate</xsl:attribute>
  57. <xsl:attribute name="type">application/x-ldx+xml</xsl:attribute>
  58. <xsl:attribute name="href"><xsl:choose><xsl:when test="function-available('ccs:encodeID')"><xsl:value-of select="concat('@report_gateway@/rds/@output@/path/@report_id@?selection=',ccs:encodeID($entryID),'&amp;v=@requestversion@')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('@report_gateway@/rds/@output@/path/@report_id@?selection=',$entryID,'&amp;v=@requestversion@')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  59. </atom:link>
  60. <cm:objectClass>reportpart</cm:objectClass>
  61. </atom:entry>
  62. </xsl:template>
  63. </xsl:stylesheet>