123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns="http://www.developer.cognos.com/schemas/bmt/57/0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fmfunc="http://www.developer.cognos.com/bmt" exclude-result-prefixes="fmfunc">
- <xsl:include href="fmmd_generalTemplates.xsl"/>
- <xsl:strip-space elements="*"/>
- <xsl:output encoding="utf-8" method="xml" indent="no"/>
-
-
-
- <xsl:template match="*[local-name()='namespace']//*[local-name()='dimension' and *[local-name()='definition']/*[local-name()='dbQuery' or local-name()='modelQuery']]/*[local-name()='hierarchy']">
- <xsl:element name="{local-name(.)}">
- <xsl:variable name="Level1Anchor" select="generate-id(./*[local-name()='level'][1])"/>
- <xsl:variable name="rootMUNAnchor" select="generate-id(./*[local-name()='level' or local-name()='balanced' or local-name()='ragged'][last()])"/>
- <xsl:for-each select="./*">
- <xsl:variable name="currentHierarchyProperty" select="generate-id(.)"/>
- <xsl:if test="$currentHierarchyProperty = $Level1Anchor">
-
- <xsl:element name="level">
-
- <xsl:for-each select="ancestor::*[local-name()='hierarchy'][1]/*[local-name()='name']">
- <xsl:element name="name">
- <xsl:attribute name="locale"><xsl:value-of select="@*[local-name()='locale']"/></xsl:attribute>
- <xsl:value-of select="concat(., $strLevelAll)"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:element name="isManual">true</xsl:element>
- </xsl:element>
- </xsl:if>
-
- <xsl:if test="local-name(.) != 'multiRoot'">
- <xsl:apply-templates select="."/>
- </xsl:if>
-
- <xsl:if test="$currentHierarchyProperty = $rootMUNAnchor">
-
- <xsl:element name="rootMUN">[all]</xsl:element>
-
-
- <xsl:for-each select="ancestor::*[local-name()='hierarchy'][1]/*[local-name()='name']">
- <xsl:element name="rootCaption">
- <xsl:attribute name="locale"><xsl:value-of select="@*[local-name()='locale']"/></xsl:attribute>
- <xsl:value-of select="concat(., $strLevelAll)"/>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </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:variable name="strLevelAll">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="stringID" select="$LEVEL_ALL"/>
- <xsl:with-param name="localeVal" select="$defaultLocale"/>
- </xsl:call-template>
- </xsl:variable>
- </xsl:stylesheet>
|