123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns="http://www.developer.cognos.com/schemas/bmt/56/0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:include href="fmmd_generalTemplates.xsl"/>
- <xsl:strip-space elements="*"/>
- <xsl:output encoding="utf-8" method="xml" indent="no"/>
-
- <xsl:template match="*[local-name()='scopeRelationship']/*[local-name()='scope']/*[local-name()='measureScope' and @*[local-name()='excluded']]">
- <xsl:element name="{local-name(.)}">
- <xsl:choose>
- <xsl:when test="@*[local-name()='excluded'] = 'excluded'">
- <xsl:attribute name="excluded">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
-
-
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:apply-templates select="./*"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="*[local-name()='dimension']//*[local-name()='measure']/*[local-name()='dbAggregationRule']"/>
-
- <xsl:template match="*[local-name()='dimension']//*[local-name()='measure' and ./*[local-name()='dbAggregationRule']]/*[local-name()='aggregationRule']"/>
-
- <xsl:template match="*[local-name()='dimension']//*[local-name()='measure' and ./*[local-name()='dbAggregationRule']]/*[local-name()='externalName' or local-name()='hidden' or local-name()='usage' or local-name()='format' or local-name()='currency' or local-name()='bmtcr1:datatype' or local-name()='precision' or local-name()='scale' or local-name()='size' or local-name()='nullable'][last()]">
-
- <xsl:call-template name="myCopy"/>
-
- <xsl:element name="aggregationRule">
- <xsl:value-of select="../*[local-name()='dbAggregationRule']"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="*[local-name()='queryItem' or local-name()='measure' or local-name()='calculation']/*[local-name()='format']/text()">
-
- <xsl:variable name="strLeftDelimiter" select="'percentScale=&quot;'"/>
- <xsl:variable name="strRightDelimiter" select="'&quot;'"/>
- <xsl:variable name="strPercentScale">
- <xsl:call-template name="substring-findDelimited">
- <xsl:with-param name="strString" select="."/>
- <xsl:with-param name="strLeftDelimiter" select="$strLeftDelimiter"/>
- <xsl:with-param name="strRightDelimiter" select="$strRightDelimiter"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="nPercentScale" select="number($strPercentScale)"/>
- <xsl:variable name="PercentScale">
- <xsl:choose>
- <xsl:when test="$nPercentScale > 0">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="."/>
- <xsl:with-param name="strFind" select="concat($strLeftDelimiter, $nPercentScale, $strRightDelimiter)"/>
- <xsl:with-param name="strReplace" select="concat($strLeftDelimiter, '-', $nPercentScale, $strRightDelimiter)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
-
- <xsl:variable name="showCentury">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$PercentScale"/>
- <xsl:with-param name="strFind" select="'showYears=&quot;show century&quot;'"/>
- <xsl:with-param name="strReplace" select="'showYears=&quot;showCentury&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="hideCentury">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showCentury"/>
- <xsl:with-param name="strFind" select="'showYears=&quot;hide century&quot;'"/>
- <xsl:with-param name="strReplace" select="'showYears=&quot;hideCentury&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showMonths_1digit">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$hideCentury"/>
- <xsl:with-param name="strFind" select="'showMonths=&quot;1 digit&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMonths=&quot;1-digit&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showMonths_2digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMonths_1digit"/>
- <xsl:with-param name="strFind" select="'showMonths=&quot;2 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMonths=&quot;2-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showMonths_shortName">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMonths_2digits"/>
- <xsl:with-param name="strFind" select="'showMonths=&quot;short name&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMonths=&quot;shortName&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showMonths_fullName">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMonths_shortName"/>
- <xsl:with-param name="strFind" select="'showMonths=&quot;full name&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMonths=&quot;fullName&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showWeekdays_shortName">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMonths_fullName"/>
- <xsl:with-param name="strFind" select="'showWeekdays=&quot;short name&quot;'"/>
- <xsl:with-param name="strReplace" select="'showWeekdays=&quot;shortName&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showWeekdays_fullName">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showWeekdays_shortName"/>
- <xsl:with-param name="strFind" select="'showWeekdays=&quot;full name&quot;'"/>
- <xsl:with-param name="strReplace" select="'showWeekdays=&quot;fullName&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showWeekdays_1digit">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showWeekdays_fullName"/>
- <xsl:with-param name="strFind" select="'showDays=&quot;1 digit&quot;'"/>
- <xsl:with-param name="strReplace" select="'showDays=&quot;1-digit&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showWeekdays_2digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showWeekdays_1digit"/>
- <xsl:with-param name="strFind" select="'showDays=&quot;2 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showDays=&quot;2-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showHours_1digit">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showWeekdays_2digits"/>
- <xsl:with-param name="strFind" select="'showHours=&quot;1 digit&quot;'"/>
- <xsl:with-param name="strReplace" select="'showHours=&quot;1-digit&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showHours_2digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showHours_1digit"/>
- <xsl:with-param name="strFind" select="'showHours=&quot;2 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showHours=&quot;2-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showMinutes_1digit">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showHours_2digits"/>
- <xsl:with-param name="strFind" select="'showMinutes=&quot;1 digit&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMinutes=&quot;1-digit&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showMinutes_2digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMinutes_1digit"/>
- <xsl:with-param name="strFind" select="'showMinutes=&quot;2 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMinutes=&quot;2-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showSeconds_1digit">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMinutes_2digits"/>
- <xsl:with-param name="strFind" select="'showSeconds=&quot;1 digit&quot;'"/>
- <xsl:with-param name="strReplace" select="'showSeconds=&quot;1-digit&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showSeconds_2digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showSeconds_1digit"/>
- <xsl:with-param name="strFind" select="'showSeconds=&quot;2 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showSeconds=&quot;2-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
-
- <xsl:variable name="showMilliSeconds_1digit">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showSeconds_2digits"/>
- <xsl:with-param name="strFind" select="'showMilliSeconds=&quot;1 digit&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMilliSeconds=&quot;1-digit&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showMilliSeconds_2digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMilliSeconds_1digit"/>
- <xsl:with-param name="strFind" select="'showMilliSeconds=&quot;2 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMilliSeconds=&quot;2-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="showMilliSeconds_3digits">
- <xsl:call-template name="substring-replace">
- <xsl:with-param name="strString" select="$showMilliSeconds_2digits"/>
- <xsl:with-param name="strFind" select="'showMilliSeconds=&quot;3 digits&quot;'"/>
- <xsl:with-param name="strReplace" select="'showMilliSeconds=&quot;3-digits&quot;'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$showMilliSeconds_3digits"/>
- </xsl:template>
-
- <xsl:variable name="sEmptyNamespace" select="string(document('')/*/namespace::*[name()=''])"/>
- <xsl:variable name="nNewSchema" select="number(substring-before(substring-after($sEmptyNamespace, 'http://www.developer.cognos.com/schemas/bmt/'), '/'))"/>
- <xsl:variable name="nOldSchema" select="$nNewSchema - 1"/>
- </xsl:stylesheet>
|