RSUpgradeBalticChart.xsl 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: rspecupgrade
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <!-- COPYRIGHT_DATA { 'YEAR':[2005, 2009], 'RELEASE':['colorado_wave1'], 'VISIBLE':'YES', 'COMPONENT':'rspecupgrade' }-->
  10. <!--All lines above the COPYRIGHT_DATA line will be replaced when copyright notices are generated. -->
  11. <!--
  12. *
  13. * Intermediate stage in upgrading from a baltic report specification
  14. * to a bering report specification.
  15. *
  16. * The input is a baltic report specification. The output is an
  17. * augmented baltic report specification that is only used as input for
  18. * further processing to get to the final bering specification.
  19. -->
  20. <xsl:stylesheet version="1.0" xmlns="http://developer.cognos.com/schemas/report/1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:baltic="http://developer.cognos.com/schemas/report/1/" xmlns:date="http://exslt.org/dates-and-times" xmlns:exsl="http://exslt.org/common" xmlns:xalan="http://xml.apache.org/xalan" xmlns:java="http://xml.apache.org/xalan/java" extension-element-prefixes="xalan date exsl" exclude-result-prefixes="xalan java baltic date exsl">
  21. <!-- For charts add chartMeasure and chartLevel elements if they do not
  22. * have them.
  23. -->
  24. <xsl:template match="baltic:chart">
  25. <chart>
  26. <xsl:apply-templates select="@*"/>
  27. <xsl:apply-templates select="child::node()"/>
  28. <xsl:if test="not(baltic:chartMeasure)">
  29. <xsl:for-each select="/baltic:report/baltic:querySet/baltic:BIQuery[@name = current()/@refQuery]/baltic:summary/baltic:dataCells/baltic:item">
  30. <chartMeasure>
  31. <chartText>
  32. <queryItemRef>
  33. <xsl:attribute name="refItem"><xsl:value-of select="@refItem"/></xsl:attribute>
  34. <xsl:attribute name="content">label</xsl:attribute>
  35. </queryItemRef>
  36. </chartText>
  37. <member>
  38. <xsl:attribute name="refMember"><xsl:value-of select="@refItem"/></xsl:attribute>
  39. </member>
  40. </chartMeasure>
  41. </xsl:for-each>
  42. </xsl:if>
  43. <xsl:if test="not(baltic:chartLevel)">
  44. <xsl:for-each select="/baltic:report/baltic:querySet/baltic:BIQuery[@name = current()/@refQuery]/baltic:summary/baltic:columnEdge/baltic:level | /baltic:report/baltic:querySet/baltic:BIQuery[@name = current()/@refQuery]/baltic:summary/baltic:rowEdge/baltic:level">
  45. <chartLevel>
  46. <xsl:attribute name="refLevel"><xsl:value-of select="@refLevel"/></xsl:attribute>
  47. <queryItemRef>
  48. <xsl:attribute name="refItem"><xsl:value-of select="baltic:item/@refItem"/></xsl:attribute>
  49. </queryItemRef>
  50. <chartText>
  51. <queryItemRef>
  52. <xsl:attribute name="refItem"><xsl:value-of select="baltic:item/@refItem"/></xsl:attribute>
  53. <xsl:attribute name="content">label</xsl:attribute>
  54. </queryItemRef>
  55. </chartText>
  56. </chartLevel>
  57. </xsl:for-each>
  58. </xsl:if>
  59. </chart>
  60. </xsl:template>
  61. </xsl:stylesheet>