12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="queryResult/item">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template match="queryResult/item[@xsi:type = 'cm:output' or @xsi:type = 'cm:graphic']">
- <xsl:choose>
- <xsl:when test="format/value = 'XHTML'">
- <report><xsl:apply-templates/></report>
- </xsl:when>
- <xsl:when test="dataType/value = 'image/png'">
- <chart><xsl:value-of select="storeID/value"/></chart>
- </xsl:when>
- <xsl:otherwise>
- <error>Invalid format: <xsl:value-of select="format/value"/></error>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Extract the response from Burgundy -->
- <xsl:template match="*[local-name()='runSpecificationResponse']">
- <xsl:value-of select="xtsext:xmldecode(result/details/item/data)" disable-output-escaping="yes"/>
- </xsl:template>
-
- <!--
- Extract the data property from the CM object. It is base64 encoded and has an XML header (<?xml?>)
- at the front of it, so decode it and remove the header.
- -->
- <xsl:template match="data">
- <xsl:value-of select="concat('<html', substring-after(xtsext:base64decode(string(value), false()), '<html'))" disable-output-escaping="yes"/>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="text()"/>
- </xsl:stylesheet>
|