123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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:out="dummy-uri" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dv="http://developer.cognos.com/schemas/xts/dv" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl dv xtsext">
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:template match="dv:variables">
- <out:variable name="toDate" select="concat(xtsext:substringBeforeLast(/root/env/param[@name='p_output_to_date'], 'T'), 'T23:59:59')"/>
-
-
- <out:variable name="fromDate" select="concat(xtsext:substringBeforeLast(/root/env/param[@name='p_output_from_date'], 'T'), 'T00:00:01')"/>
- <out:variable name="today" select="concat(xtsext:substringBeforeLast(xtsext:getCurrentDateTime(/root/user/param[@name='timeZoneID']), 'T'), 'T23:59:59')"/>
- <out:variable name="oneMonthAgoAdj" select="xtsext:getDateTimeOffset($today, '-1', 'month')"/>
- <out:variable name="oneMonthAgo" select="xtsext:getDateTimeOffset($oneMonthAgoAdj, '-1439', 'minute')"/>
- <out:variable name="output_date">
- <out:if test="/root/env/param[@name='p_output_date']">
- <out:value-of select="xtsext:formatDateToUTC(/root/env/param[@name='p_output_date'], /root/user/param[@name='timeZoneID'])"/>
- </out:if>
- </out:variable>
- <out:variable name="output_from_date_unAdj">
- <out:choose>
- <out:when test="not(/root/env/param[@name='p_output_from_date'])">
- <out:value-of select="$oneMonthAgo"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$fromDate"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="output_to_date_unAdj">
- <out:choose>
- <out:when test="not(/root/env/param[@name='p_output_to_date'])">
- <out:value-of select="$today"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$toDate"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
-
- <out:variable name="output_from_date" select="xtsext:formatDateToUTC($output_from_date_unAdj, /root/user/param[@name='timeZoneID'])"/>
- <out:variable name="output_to_date" select="xtsext:formatDateToUTC($output_to_date_unAdj, /root/user/param[@name='timeZoneID'])"/>
-
- <out:variable name="requestFromDate">
- <out:choose>
- <out:when test="/root/env/param[@name = 'p_period'] = 'day'">
- <out:variable name="selectedDay_start" select="concat(xtsext:substringBeforeLast(/root/env/param[@name='p_output_date'], 'T'), 'T00:00:01')"/>
- <out:value-of select="xtsext:formatDateToUTC($selectedDay_start, /root/user/param[@name='timeZoneID'])"/>
- </out:when>
- <out:otherwise><out:value-of select="$output_from_date"/>Z</out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="requestToDate">
- <out:choose>
- <out:when test="/root/env/param[@name = 'p_period'] = 'day'">
- <out:variable name="selectedDay_end" select="concat(xtsext:substringBeforeLast(/root/env/param[@name='p_output_date'], 'T'), 'T23:59:59')"/>
- <out:value-of select="xtsext:formatDateToUTC($selectedDay_end, /root/user/param[@name='timeZoneID'])"/>
- </out:when>
- <out:otherwise><out:value-of select="$output_to_date"/>Z</out:otherwise>
- </out:choose>
- </out:variable>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|