prompting.xsl 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: rs
  5. (C) Copyright IBM Corp. 2018, 2020
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rsext="xalan://com.cognos.reportserver.ext.RSExt" exclude-result-prefixes="xsl">
  10. <xsl:template match="textBox | selectValue | selectWithSearch | selectWithTree | selectDate | selectTime | selectDateTime | selectInterval | selectFile | selectDataSourceSignon" priority="2">
  11. <xsl:copy>
  12. <xsl:attribute name="specname"><xsl:choose><xsl:when test="@layoutClass"><xsl:value-of select="@layoutClass"/></xsl:when><xsl:otherwise><xsl:value-of select="name()"/></xsl:otherwise></xsl:choose></xsl:attribute>
  13. <xsl:copy-of select="@*[name(.) != 'layoutClass']"/>
  14. <xsl:copy-of select="HA/@*[name(.) != 'layoutClass']"/>
  15. <xsl:copy-of select="*[not(self::HA | self::selectOptions | self::selectChoices)]"/>
  16. <xsl:apply-templates select="selectOptions | selectChoices"/>
  17. </xsl:copy>
  18. </xsl:template>
  19. <xsl:template match="selectOptions | selectChoices" priority="2">
  20. <xsl:copy>
  21. <xsl:copy-of select="@*[name(.) != 'layoutClass']"/>
  22. <xsl:copy-of select="*[not(self::selectOption)]"/>
  23. <xsl:for-each select="selectOption">
  24. <xsl:call-template name="outputSelectOption"/>
  25. </xsl:for-each>
  26. </xsl:copy>
  27. </xsl:template>
  28. <xsl:template name="outputSelectOption">
  29. <xsl:element name="selectOption">
  30. <xsl:copy-of select="./@*[name() != 'layoutClass']"/>
  31. <xsl:copy-of select="./*"/>
  32. </xsl:element>
  33. </xsl:template>
  34. <xsl:template match="promptButton" priority="2">
  35. <xsl:copy>
  36. <xsl:if test="(@type='back' and /Document/DATA/PAGE/@canBack='false') or (@type='next' and /Document/DATA/PAGE/@canNext='false') or (@type='finish' and /Document/DATA/PAGE/@canFinish='false')">
  37. <xsl:attribute name="disabled">true</xsl:attribute>
  38. </xsl:if>
  39. <xsl:attribute name="specname"><xsl:value-of select="@layoutClass"/></xsl:attribute>
  40. <xsl:copy-of select="@*[name(.) != 'layoutClass']"/>
  41. <xsl:copy-of select="HA/@*[name(.) != 'layoutClass']"/>
  42. <xsl:apply-templates select="*"/>
  43. </xsl:copy>
  44. </xsl:template>
  45. <xsl:template match="FORM[@layoutClass='block' and @defaultPromptControl='true']" priority="2">
  46. <div>
  47. <div><xsl:value-of select="@columnName"/></div>
  48. <xsl:copy-of select="@*[name(.) != 'layoutClass']"/>
  49. <xsl:apply-templates select="*"/>
  50. </div>
  51. </xsl:template>
  52. <xsl:template match="OTD[@layoutClass='pageHeader' and @defaultPromptHeader='true'] | OTD[@layoutClass='pageFooter' and @defaultPromptFooter='true']" priority="2">
  53. <td>
  54. <xsl:copy-of select="@*[name(.) != 'layoutClass']"/>
  55. <xsl:copy-of select="../../@generateRepromptButton"/>
  56. </td>
  57. </xsl:template>
  58. </xsl:stylesheet>