123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2008
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- ================================================================================
- extract and clean up the parameters for cm
- ===============================================================================================
- -->
- <xsl:stylesheet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xsl:element name="agent_items_params">
- <xsl:attribute name="xmlns:xs"><xsl:text>http://www.w3.org/2001/XMLSchema</xsl:text></xsl:attribute>
- <xsl:for-each select="/root/agent_item">
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="params">
- <xsl:value-of select="xtsext:web64decode( string( /root/agent_item[@id = $id]/param[@name='taskParameters'] ), true() )" disable-output-escaping="yes"/>
- </xsl:variable>
- <xsl:element name="agent_item_params">
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
- <xsl:if test="./param[@name='taskParameters']">
- <xsl:copy-of select="$params"/>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xts:append>
- <!--remove the parameters without values... they only confuse cm -->
- <xts:delete select="/root/agent_items_params/agent_item_params/parameterData/parameterValues/item[not(./*[local-name()='value'])]"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|