12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?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.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rsext="xalan://com.cognos.reportserver.ext.RSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:include href="V5html.xsl"/>
- <!-- we're actually generating XML in here now of the following format - we only generate the use attribute on the value element if the use
- and the display differ
- <values>
- <value use="a" display="a1"/>
- <value use="b" display="b1"/>
- <value use="c" display="c1"/>
- </values>
- <type>45</type> -->
- <xsl:template match="/">
- <xsl:choose>
- <!-- cannot test to see if there is a //DRI[@type='datavalue']/OTI[@layoutClass='textItem'] cause in the instance where there
- isn't a value returned we'll end up converting a null table into a HTML page - which is incorrect. Check for a table header -->
- <xsl:when test="//DRI[@type='columnTitle']">
- <xsl:call-template name="selectValues"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="prompt"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="selectValues">
- <values>
- <xsl:for-each select="//DRI[@type='datavalue']/OTI[@layoutClass='textItem']">
- <xsl:if test="not(contains(@style,'visibility:hidden'))">
- <xsl:variable name="ctx" select="./@ctx"/>
- <!-- get the use and display values -->
- <xsl:variable name="useValue" select="//CD[@ctxId = $ctx]/@useValue"/>
- <xsl:variable name="displayValue" select="./text()"/>
- <value>
- <xsl:attribute name="display"><xsl:value-of select="$displayValue"/></xsl:attribute>
- <!-- only send the use value if it's different to the display value -->
- <xsl:if test="not($displayValue = $useValue)">
- <xsl:attribute name="use"><xsl:value-of select="$useValue"/></xsl:attribute>
- </xsl:if>
- </value>
- </xsl:if>
- </xsl:for-each>
- </values>
- <type>
- <xsl:value-of select="/Document/META-DATA/DA/@dtype"/>
- </type>
- </xsl:template>
- <xsl:template name="prompt">
- <xsl:apply-templates/>
- </xsl:template>
- </xsl:stylesheet>
|