123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!--
- This is a temp transform until uiExtentions gets moved to tier 3 and we can do all of this a compile time
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
-
- <xsl:template match="/root/barChart">
- <xsl:variable name="type" select="type"/>
- <xsl:variable name="yTitle" select="xtsext:javascriptencode(yTitle)"/>
- <xsl:variable name="xTitle" select="xtsext:javascriptencode(xTitle)"/>
- <xsl:variable name="titles">
- <xsl:value-of select="concat('"titles":{"xTitle":"',$xTitle,'","yTitle":"',$yTitle,'"}')"/>
- </xsl:variable>
- <xsl:variable name="rows">
- <xsl:value-of select="'"rows":['"/>
- <xsl:for-each select="row">
- <xsl:variable name="label"><xsl:value-of select="xtsext:javascriptencode(string(label))"/></xsl:variable>
- <xsl:variable name="value"><xsl:value-of select="value"/></xsl:variable>
- <xsl:value-of select="concat('{"label":"',$label,'","value":"',$value,'"}')"/>
- <xsl:if test="position()!=last()"><xsl:value-of select="','"/></xsl:if>
- </xsl:for-each>
- <xsl:value-of select="']'"/>
- </xsl:variable>
- <xsl:variable name="data">
- <xsl:value-of select="concat('{"type":"',$type,'",',$titles,',',$rows,'}')"/>
- </xsl:variable>
-
- <!--cusomized variables for different chart viewer-->
- <xsl:variable name="source" select="xtsext:urlencode($data)"/>
-
- <!--the final output url-->
- <cogadminChartUrl>
- <xsl:value-of select="concat('/simplechartviewer?source=',$source)"/>
- </cogadminChartUrl>
- </xsl:template>
- </xsl:stylesheet>
|