12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Transform used to update the list of future tasks which can be run. The format of the input is
- <root>
- <followingTaskList>
- <futureTask>
- <display><xsl:value-of select="./name"/></display>
- <id><xsl:value-of select="./id"/></id>
- <taskType><xsl:value-of select=".type"/></taskType>
- </futureTask>
- </followingTaskList>
- <futureTasks>
- <param name="m_ro_agentTaskItem_AgentTask-ABC">true</param>
- <param name="m_ro_agentTaskItem_AgentTask-DEF">true</param>
- <param name="m_ro_agentTaskItem_AgentTask-GHI">true</param>
- <param name="m_ro_agentTaskItem_display_AgentTask-ABC">TaskABC name to be displayed</param>
- <param name="m_ro_agentTaskItem_display_AgentTask-DEF">TaskDEF name to be displayed</param>
- <param name="m_ro_agentTaskItem_display_AgentTask-GHI">TaskGHI name to be displayed</param>
- </futureTasks>
- <allTasks>
- </root>
- and will return
- <futureTask>
- <display>
- <id>
- <taskType>
- </futureTask>
- ....
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- exclude-result-prefixes="xsl xts xtsext pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/root">
- <xsl:for-each select="/root/followingTaskList/futureTask">
- <xsl:variable name="id" select="./id"/>
- <xsl:if test="/root/allTasks='true' or /root/futureTasks/param[@name=concat('m_ro_agentTaskItem_', $id)]">
- <futureTask>
- <!-- display is the value of the name given to the task -->
- <display><xsl:value-of select="/root/futureTasks/param[@name=concat('m_ro_agentTaskItem_display_', $id)]"/></display>
- <id><xsl:value-of select="./id"/></id>
- <taskType><xsl:value-of select="./taskType"/></taskType>
- </futureTask>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>
|