RSUpgradeStyleMap.xsl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:baltic="http://developer.cognos.com/schemas/report/1/" xmlns="http://developer.cognos.com/schemas/report/2.0/" 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">
  12. <!-- Assign class attribute based on Bering default from RSUpgradeStyleMap.xml -->
  13. <xsl:template name="addStyle">
  14. <xsl:param name="el" select="."/>
  15. <xsl:param name="for" select="local-name($el)"/>
  16. <xsl:param name="default" select="'true'"/>
  17. <xsl:variable name="v_class">
  18. <xsl:value-of select="$el/@class"/>
  19. </xsl:variable>
  20. <xsl:choose>
  21. <xsl:when test="$v_class != ''">
  22. <xsl:variable name="v_mappedClass">
  23. <xsl:value-of select="$var_styles//s[@for = $v_class]/@name"/>
  24. </xsl:variable>
  25. <xsl:choose>
  26. <xsl:when test="$v_mappedClass != ''">
  27. <xsl:attribute name="class"><xsl:value-of select="$v_mappedClass"/></xsl:attribute>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xsl:attribute name="class"><xsl:value-of select="$v_class"/></xsl:attribute>
  31. </xsl:otherwise>
  32. </xsl:choose>
  33. </xsl:when>
  34. <xsl:otherwise>
  35. <!-- No class attribute has been specified on the baltic element. -->
  36. <xsl:if test="$default = 'true'">
  37. <xsl:variable name="v_mappedClass">
  38. <xsl:value-of select="$var_styles//s[@for = $for]/@name"/>
  39. </xsl:variable>
  40. <xsl:if test="$v_mappedClass != ''">
  41. <xsl:attribute name="class"><xsl:value-of select="$v_mappedClass"/></xsl:attribute>
  42. </xsl:if>
  43. </xsl:if>
  44. </xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:template>
  47. </xsl:stylesheet>