update_futureTasks.xslt 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ASV
  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. <!--
  9. Transform used to update the list of future tasks which can be run. The format of the input is
  10. <root>
  11. <followingTaskList>
  12. <futureTask>
  13. <display><xsl:value-of select="./name"/></display>
  14. <id><xsl:value-of select="./id"/></id>
  15. <taskType><xsl:value-of select=".type"/></taskType>
  16. </futureTask>
  17. </followingTaskList>
  18. <futureTasks>
  19. <param name="m_ro_agentTaskItem_AgentTask-ABC">true</param>
  20. <param name="m_ro_agentTaskItem_AgentTask-DEF">true</param>
  21. <param name="m_ro_agentTaskItem_AgentTask-GHI">true</param>
  22. <param name="m_ro_agentTaskItem_display_AgentTask-ABC">TaskABC name to be displayed</param>
  23. <param name="m_ro_agentTaskItem_display_AgentTask-DEF">TaskDEF name to be displayed</param>
  24. <param name="m_ro_agentTaskItem_display_AgentTask-GHI">TaskGHI name to be displayed</param>
  25. </futureTasks>
  26. <allTasks>
  27. </root>
  28. and will return
  29. <futureTask>
  30. <display>
  31. <id>
  32. <taskType>
  33. </futureTask>
  34. ....
  35. -->
  36. <xsl:stylesheet version="1.0"
  37. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  38. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  39. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  40. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  41. exclude-result-prefixes="xsl xts xtsext pf">
  42. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  43. <xsl:template match="/root">
  44. <xsl:for-each select="/root/followingTaskList/futureTask">
  45. <xsl:variable name="id" select="./id"/>
  46. <xsl:if test="/root/allTasks='true' or /root/futureTasks/param[@name=concat('m_ro_agentTaskItem_', $id)]">
  47. <futureTask>
  48. <!-- display is the value of the name given to the task -->
  49. <display><xsl:value-of select="/root/futureTasks/param[@name=concat('m_ro_agentTaskItem_display_', $id)]"/></display>
  50. <id><xsl:value-of select="./id"/></id>
  51. <taskType><xsl:value-of select="./taskType"/></taskType>
  52. </futureTask>
  53. </xsl:if>
  54. </xsl:for-each>
  55. </xsl:template>
  56. </xsl:stylesheet>