upgradeJobStepOptions.xslt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="x" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl xsi x">
  13. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  14. <xsl:template match="*[local-name()='queryResponse']" priority="1">
  15. <xsl:copy>
  16. <xsl:copy-of select="@*"/>
  17. <!-- loop through all the job steps -->
  18. <xsl:for-each select="*[local-name()='jobStepDefinition']">
  19. <!-- want to see if savePromptCache already exists -->
  20. <xsl:variable name="promptCacheModeAlreadyExists">
  21. <xsl:value-of select="*[local-name()='options']/*[local-name()='value']/*[local-name()='item']/*[local-name()='name']='promptCacheMode'"/>
  22. </xsl:variable>
  23. <xsl:copy>
  24. <xsl:copy-of select="@*"/>
  25. <xsl:apply-templates select="*">
  26. <xsl:with-param name="promptCacheModeAlreadyExists" select="$promptCacheModeAlreadyExists"/>
  27. </xsl:apply-templates>
  28. </xsl:copy>
  29. </xsl:for-each>
  30. </xsl:copy>
  31. </xsl:template>
  32. <xsl:template match="*[local-name()='item' and *[local-name()='name']='savePromptCache']">
  33. <xsl:param name="promptCacheModeAlreadyExists" select="false()"/>
  34. <xsl:choose>
  35. <xsl:when test="not($promptCacheModeAlreadyExists)">
  36. <item xsi:type="bus:runOptionPromptCacheMode">
  37. <name xsi:type="bus:runOptionEnum">promptCacheMode</name>
  38. <value xsi:type="bus:promptCacheModeEnum">
  39. <xsl:choose>
  40. <xsl:when test="*[local-name()='value']='true'">create</xsl:when>
  41. <xsl:otherwise>none</xsl:otherwise>
  42. </xsl:choose>
  43. </value>
  44. </item>
  45. </xsl:when>
  46. </xsl:choose>
  47. </xsl:template>
  48. <!--
  49. This next template is required to copy all other elements into the result
  50. -->
  51. <xsl:template match="*">
  52. <xsl:copy>
  53. <xsl:copy-of select="@*|text()"/>
  54. <xsl:apply-templates select="*"/>
  55. </xsl:copy>
  56. </xsl:template>
  57. </xsl:stylesheet>