MINI MINI MANI MO
<?xml version="1.0" encoding="utf-8"?>
<!--
NAME
kuhier.xsl
DESCRIPTION
XSLT stylesheet for XML => MDS objects
NOTES
MODIFIED MM/DD/YY
almurphy 07/13/17 - Only print dynamic across levels clause when on
joevilla 04/26/17 - add template PrintADimJoinPath
sfeinste 01/31/17 - Bug 25475947: Add version check
sfeinste 11/30/16 - Proj 70791: [NOT] DYNAMIC ACROSS ALL LEVELS
almurphy 07/27/16 - add REFERENCES DISTINCT to ANALYTIC VIEW
almurphy 07/08/16 - clean up DDL indenting and support transform params
mstasiew 02/05/16 - Bug 22658620: partitioned or missing tables
beiyu 01/21/16 - print owner of base obj when owner_in_ddl is TRUE
beiyu 12/15/15 - Bug 20619944: add level_type column
smesropi 09/30/15 - Bug 21910928: Remove ALL MEMBER NAME single quote
smesropi 10/31/15 - Bug 21171628: Rename HCS tables/views
ghicks 10/26/15 - Bug 21384717: quote the default measure name
mstasiew 10/13/15 - Bug 21984764: hcs object rename
mstasiew 09/25/15 - Bug 21867527: hier cube measure cache
mstasiew 08/27/15 - Bug 21384694: hier hier attr classifications
mstasiew 08/10/15 - Bug 21608047: rm blank line when no classifications
mstasiew 06/18/15 - Bug 20744700: datapump non-pretty fixes
mstasiew 05/22/15 - Bug 20845805: hierarchy cube improvements
mstasiew 05/07/15 - Bug 20845789: hierarchy dimension improvements
mstasiew 12/27/13 - created
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="kucommon.xsl"/>
<!-- Top-level parameters -->
<xsl:param name="PRETTY">1</xsl:param>
<xsl:param name="SQLTERMINATOR">1</xsl:param>
<xsl:param name="EXPORT">0</xsl:param>
<xsl:param name="FORCE">1</xsl:param>
<xsl:param name="LINESIZE">80</xsl:param>
<!-- params for parse -->
<xsl:param name="PRS_DDL">0</xsl:param>
<xsl:param name="PRS_DELIM">\{]`</xsl:param>
<xsl:param name="PRS_VERB">0</xsl:param>
<xsl:param name="PRS_OBJECT_TYPE">0</xsl:param>
<xsl:param name="PRS_SCHEMA">0</xsl:param>
<xsl:param name="PRS_NAME">0</xsl:param>
<xsl:param name="PRS_GRANTEE">0</xsl:param>
<xsl:param name="PRS_GRANTOR">0</xsl:param>
<xsl:param name="PRS_BASE_OBJECT_SCHEMA">0</xsl:param>
<xsl:param name="PRS_BASE_OBJECT_NAME">0</xsl:param>
<xsl:param name="PRS_BASE_OBJECT_TYPE">0</xsl:param>
<!-- Print an indent of the given size -->
<xsl:template name="PrintIndent">
<xsl:param name="IndentSize"/>
<xsl:if test="$IndentSize>0">
<xsl:call-template name="PrintIndent">
<xsl:with-param name="IndentSize" select="($IndentSize)-1"/>
</xsl:call-template>
</xsl:if>
<xsl:text> </xsl:text>
</xsl:template>
<!-- Print a newline and indent -->
<xsl:template name="PrintNLIndent">
<xsl:param name="IndentSize"/>
<xsl:param name="DoNonPrettySep" select="1"/>
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:choose>
<xsl:when test="$DoPrettyPrint=1">
<xsl:text>
</xsl:text>
<xsl:call-template name="PrintIndent">
<xsl:with-param name="IndentSize" select="$IndentSize"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$DoNonPrettySep=1">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Print a list separator -->
<xsl:template name="PrintListSep">
<xsl:param name="IndentSize"/>
<xsl:param name="Pos"/>
<xsl:param name="IsParenList" select="0"/>
<xsl:param name="BeforeSep" select=""/>
<xsl:param name="AfterSep" select=""/>
<xsl:param name="SkipFirstSep" select="0"/>
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:variable name="DoNonPrettySep">
<xsl:choose>
<xsl:when test="$IsParenList=1 and $Pos=1">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($Pos=1)">
<xsl:value-of select="$BeforeSep"/>
</xsl:if>
<xsl:if test="not($Pos=1) or not($SkipFirstSep)">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="$IndentSize"/>
<xsl:with-param name="DoNonPrettySep" select="$DoNonPrettySep"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not($Pos=1)">
<xsl:value-of select="$AfterSep"/>
</xsl:if>
</xsl:template>
<!-- Print optionally wrapped block -->
<xsl:template name="PrintWrapBlock">
<xsl:param name="PntDoPrettyPrint" select="$PRETTY"/>
<xsl:param name="IndentSize"/>
<xsl:param name="BlockName"/>
<xsl:variable name="BlockText">
<xsl:call-template name="PrintBlock">
<xsl:with-param name="BlockName" select="$BlockName"/>
<xsl:with-param name="IndentSize" select="$IndentSize"/>
<xsl:with-param name="DoPrettyPrint" select="0"/>
<xsl:with-param name="PntDoPrettyPrint" select="$PntDoPrettyPrint"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="CmpBlockText">
<xsl:choose>
<xsl:when test="contains($BlockText, '
')">
<xsl:value-of select="substring-after($BlockText, '
')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$BlockText"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$PntDoPrettyPrint=0 or ($LINESIZE>=string-length($CmpBlockText) and not(contains($CmpBlockText, '
')))">
<xsl:value-of select="$BlockText"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="PrintBlock">
<xsl:with-param name="BlockName" select="$BlockName"/>
<xsl:with-param name="IndentSize" select="$IndentSize"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Print a single CLASSIFICATION -->
<xsl:template name="PrintClsfn">
<xsl:param name="IndentSize"/>
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="$IndentSize"/>
<xsl:with-param name="Pos" select="position()"/>
</xsl:call-template>
<xsl:text>CLASSIFICATION </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="CLSFCTION_NAME"/>
</xsl:call-template>
<xsl:if test="CLSFCTION_VALUE">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="($IndentSize)+1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:text>VALUE </xsl:text>
<xsl:call-template name="SingleQuotedName">
<xsl:with-param name="NameNode" select="CLSFCTION_VALUE"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="CLSFCTION_LANG">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="($IndentSize)+1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:text>LANGUAGE </xsl:text>
<xsl:call-template name="SingleQuotedName">
<xsl:with-param name="NameNode" select="CLSFCTION_LANG"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- Print schema qualified object -->
<xsl:template name="PrintSchemaObj">
<xsl:param name="OwnerInDDL"/>
<xsl:param name="ObjName"/>
<xsl:param name="ObjOwner"/>
<xsl:if test="$OwnerInDDL=1">
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="$ObjOwner"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
</xsl:if>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="$ObjName"/>
</xsl:call-template>
</xsl:template>
<!-- Print object header -->
<xsl:template name="PrintObjHeader">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:variable name="MDObjType">
<xsl:choose>
<xsl:when test="contains(SCHEMA_OBJ/TYPE_NAME,' ')">
<xsl:value-of select="concat(substring-before(SCHEMA_OBJ/TYPE_NAME,' '),'_',substring-after(SCHEMA_OBJ/TYPE_NAME,' '))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="SCHEMA_OBJ/TYPE_NAME"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="DoParse">
<xsl:with-param name="Verb">CREATE</xsl:with-param>
<xsl:with-param name="ObjectType" select="$MDObjType"/>
<xsl:with-param name="SchemaNode" select="SCHEMA_OBJ/OWNER_NAME"/>
<xsl:with-param name="NameNode" select="SCHEMA_OBJ/NAME"/>
</xsl:call-template>
<xsl:text>CREATE </xsl:text>
<xsl:if test="$EXPORT=0">
<xsl:text>OR REPLACE </xsl:text>
</xsl:if>
<xsl:if test="$FORCE=1">FORCE </xsl:if>
<xsl:value-of select="SCHEMA_OBJ/TYPE_NAME"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="SCHEMA_OBJ/OWNER_NAME"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="SCHEMA_OBJ/NAME"/>
</xsl:call-template>
</xsl:template>
<!-- Print USING for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimUsing">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>USING</xsl:text>
<xsl:for-each select="SRC_LIST/SRC_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="PrintSchemaObj">
<xsl:with-param name="OwnerInDDL" select="OWNER_IN_DDL"/>
<xsl:with-param name="ObjName" select="NAME"/>
<xsl:with-param name="ObjOwner" select="OWNER"/>
</xsl:call-template>
<xsl:text> AS </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="ALIAS"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Print ATTRIBUTES for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimAttrs">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>ATTRIBUTES (</xsl:text>
<xsl:for-each select="ATTR_LIST/ATTR_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:if test="TABLE_ALIAS">
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="TABLE_ALIAS"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
</xsl:if>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="SRC_COL_NAME"/>
</xsl:call-template>
<xsl:text> AS </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="3"/>
</xsl:call-template>
</xsl:for-each> <!-- attributes list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print level key for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimLvlKey">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
</xsl:call-template>
<xsl:if test="position()>1">
<xsl:text>ALTERNATE </xsl:text>
</xsl:if>
<xsl:text>KEY (</xsl:text>
<xsl:for-each select="ATTR_LIST/ATTR_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- key attr list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print level member name for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimLvlMbrName">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>MEMBER NAME</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="MEMBER_NAME"/>
</xsl:template>
<!-- Print Print a Dim JoinPath -->
<xsl:template name="PrintADimJoinPath">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>JOIN PATH </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:text>ON </xsl:text>
<xsl:value-of select="ON_CONDITION"/>
</xsl:template>
<!-- Print level member caption for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimLvlMbrCaption">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:if test="MEMBER_CAPTION">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>MEMBER CAPTION</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="MEMBER_CAPTION"/>
</xsl:if>
</xsl:template>
<!-- Print level member description for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimLvlMbrDesc">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:if test="MEMBER_DESC">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>MEMBER DESCRIPTION</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="MEMBER_DESC"/>
</xsl:if>
</xsl:template>
<!-- Print level order by for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimLvlOrds">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>ORDER BY</xsl:text>
<xsl:for-each select="ORDBY_LIST/ORDBY_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="AGG_FUNC"/>
<xsl:text> </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="ATTRIBUTE_NAME"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="CRITERIA"/>
<xsl:text> NULLS </xsl:text>
<xsl:value-of select="NULLS_POSITION"/>
</xsl:for-each> <!-- order by list -->
</xsl:template>
<!-- Print level determines for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimLvlDtms">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:if test="DTM_ATTR_LIST/DTM_ATTR_LIST_ITEM">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>DETERMINES (</xsl:text>
<xsl:for-each select="DTM_ATTR_LIST/DTM_ATTR_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- determines attr list -->
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:template>
<!-- Print all member name for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimAllMbrName">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:variable name="DoAllSep">
<xsl:choose>
<xsl:when test="not(ALL_MEMBER_CAPTION) and not(ALL_MEMBER_DESC)">
<xsl:value-of select="$DoPrettyPrint"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$PRETTY"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>ALL</xsl:text>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimAllMbrNameExpr'"/>
<xsl:with-param name="PntDoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:template>
<!-- Print all member name expr for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimAllMbrNameExpr">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:param name="PntDoPrettyPrint" select="$PRETTY"/>
<xsl:variable name="DoAllSep">
<xsl:choose>
<xsl:when test="not(ALL_MEMBER_CAPTION) and not(ALL_MEMBER_DESC)">
<xsl:value-of select="$PntDoPrettyPrint"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$PRETTY"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="DoPrettyPrint" select="$DoAllSep"/>
</xsl:call-template>
<xsl:text>MEMBER NAME</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="ALL_MEMBER_NAME"/>
</xsl:template>
<!-- Print all member caption for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimAllMbrCaption">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:if test="ALL_MEMBER_CAPTION">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>MEMBER CAPTION</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="ALL_MEMBER_CAPTION"/>
</xsl:if>
</xsl:template>
<!-- Print all member description for ATTRIBUTE DIMENSION -->
<xsl:template name="PrintADimAllMbrDesc">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:if test="ALL_MEMBER_DESC">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>MEMBER DESCRIPTION</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="ALL_MEMBER_DESC"/>
</xsl:if>
</xsl:template>
<!-- Print USING for HIERARCHY -->
<xsl:template name="PrintHierUsing">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>USING</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="PrintSchemaObj">
<xsl:with-param name="OwnerInDDL" select="OWNER_IN_DDL"/>
<xsl:with-param name="ObjName" select="DIM_NAME"/>
<xsl:with-param name="ObjOwner" select="DIM_OWNER"/>
</xsl:call-template>
</xsl:template>
<!-- Print levels for HIERARCHY -->
<xsl:template name="PrintHierLvls">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:for-each select="LVL_LIST/LVL_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="AfterSep" select="'CHILD OF '"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="SkipFirstSep" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- level list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print USING for ANALYTIC VIEW -->
<xsl:template name="PrintAViewUsing">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>USING</xsl:text>
<xsl:for-each select="SRC_LIST/SRC_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="PrintSchemaObj">
<xsl:with-param name="OwnerInDDL" select="OWNER_IN_DDL"/>
<xsl:with-param name="ObjName" select="NAME"/>
<xsl:with-param name="ObjOwner" select="OWNER"/>
</xsl:call-template>
<xsl:text> AS </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="ALIAS"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- Print dimension key for ANALYTIC VIEW -->
<xsl:template name="PrintAViewDimKey">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewDimKeyClause'"/>
<xsl:with-param name="PntDoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewDimRefClause'"/>
<xsl:with-param name="PntDoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:template>
<!-- Print dimension key clause for ANALYTIC VIEW -->
<xsl:template name="PrintAViewDimKeyClause">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
</xsl:call-template>
<xsl:text>KEY (</xsl:text>
<xsl:for-each select="KEY_LIST/KEY_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="5"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name ="QuoteObject">
<xsl:with-param name="Object" select="KEY_COL_NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- key list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print dimension references clause for ANALYTIC VIEW -->
<xsl:template name="PrintAViewDimRefClause">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:param name="PntDoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="4"/>
<xsl:with-param name="DoPrettyPrint" select="$PntDoPrettyPrint"/>
</xsl:call-template>
<xsl:text>REFERENCES </xsl:text>
<xsl:if test="REF_DISTINCT=1">
<xsl:text>DISTINCT </xsl:text>
</xsl:if>
<xsl:text>(</xsl:text>
<xsl:for-each select="KEY_LIST/KEY_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="5"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="REF_ATTR_NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- key list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print dimension hierarchies for ANALYTIC VIEW -->
<xsl:template name="PrintAViewDimHiers">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
</xsl:call-template>
<xsl:text>HIERARCHIES (</xsl:text>
<xsl:for-each select="HIER_LIST/HIER_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="4"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="PrintSchemaObj">
<xsl:with-param name="OwnerInDDL" select="OWNER_IN_DDL"/>
<xsl:with-param name="ObjName" select="HIER_NAME"/>
<xsl:with-param name="ObjOwner" select="HIER_OWNER"/>
</xsl:call-template>
<xsl:text> AS </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="HIER_ALIAS"/>
</xsl:call-template>
<xsl:if test="IS_DEFAULT='Y'">
<xsl:text> DEFAULT</xsl:text>
</xsl:if>
</xsl:for-each> <!-- hier list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print measures for ANALYTIC VIEW -->
<xsl:template name="PrintAViewMeasList">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>MEASURES (</xsl:text>
<xsl:for-each select="MEAS_LIST/MEAS_LIST_ITEM">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewMeas'"/>
<xsl:with-param name="PntDoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:for-each> <!-- measure list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print single measure for ANALYTIC VIEW -->
<xsl:template name="PrintAViewMeas">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:param name="PntDoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$PntDoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="ALIAS"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="MEAS_TYPE=1">
<xsl:text> FACT </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="SRC_COL_NAME"/>
</xsl:call-template>
<xsl:if test="AGGR">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:text>AGGREGATE BY </xsl:text>
<xsl:value-of select="AGGR"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text> AS (</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoNonPrettySep" select="0"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:value-of select="EXPR"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="3"/>
</xsl:call-template>
</xsl:template>
<!-- Print default measure for ANALYTIC VIEW -->
<xsl:template name="PrintAViewDfltMeas">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>DEFAULT MEASURE</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="DEF_MEAS"/>
</xsl:call-template>
</xsl:template>
<!-- Print cache measures for ANALYTIC VIEW -->
<xsl:template name="PrintAViewCacheMeas">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
</xsl:call-template>
<xsl:text>MEASURE GROUP (</xsl:text>
<xsl:for-each select="MEAS_LIST/MEAS_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="4"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="MEAS_NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- meas list -->
<xsl:text>)</xsl:text>
</xsl:template>
<!-- Print cache levels for ANALYTIC VIEW -->
<xsl:template name="PrintAViewCacheLvls">
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="Pos" select="position()"/>
</xsl:call-template>
<xsl:text>LEVELS (</xsl:text>
<xsl:for-each select="LVL_LIST/LVL_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="4"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
<xsl:if test="DIM_ALIAS">
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="DIM_ALIAS"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
</xsl:if>
<xsl:if test="HIER_ALIAS">
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="HIER_ALIAS"/>
</xsl:call-template>
<xsl:text>.</xsl:text>
</xsl:if>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="LEVEL_NAME"/>
</xsl:call-template>
</xsl:for-each> <!-- lvl list -->
<xsl:text>) </xsl:text>
<xsl:value-of select="CACHE_TYPE"/>
</xsl:template>
<!-- Print block -->
<xsl:template name="PrintBlock">
<xsl:param name="BlockName"/>
<xsl:param name="IndentSize"/>
<xsl:param name="DoPrettyPrint" select="$PRETTY"/>
<xsl:param name="PntDoPrettyPrint" select="$PRETTY"/>
<xsl:choose>
<xsl:when test="$BlockName='PrintObjHeader'">
<xsl:call-template name="PrintObjHeader">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintClsfn'">
<xsl:call-template name="PrintClsfn">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
<xsl:with-param name="IndentSize" select="$IndentSize"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimAttrs'">
<xsl:call-template name="PrintADimAttrs">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimUsing'">
<xsl:call-template name="PrintADimUsing">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimLvlKey'">
<xsl:call-template name="PrintADimLvlKey">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimLvlMbrName'">
<xsl:call-template name="PrintADimLvlMbrName">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimLvlMbrCaption'">
<xsl:call-template name="PrintADimLvlMbrCaption">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimLvlMbrDesc'">
<xsl:call-template name="PrintADimLvlMbrDesc">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimLvlOrds'">
<xsl:call-template name="PrintADimLvlOrds">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimLvlDtms'">
<xsl:call-template name="PrintADimLvlDtms">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimAllMbrName'">
<xsl:call-template name="PrintADimAllMbrName">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimAllMbrNameExpr'">
<xsl:call-template name="PrintADimAllMbrNameExpr">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
<xsl:with-param name="PntDoPrettyPrint" select="$PntDoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimAllMbrCaption'">
<xsl:call-template name="PrintADimAllMbrCaption">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimAllMbrDesc'">
<xsl:call-template name="PrintADimAllMbrDesc">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintHierUsing'">
<xsl:call-template name="PrintHierUsing">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintHierLvls'">
<xsl:call-template name="PrintHierLvls">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewUsing'">
<xsl:call-template name="PrintAViewUsing">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewDimKey'">
<xsl:call-template name="PrintAViewDimKey">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewDimKeyClause'">
<xsl:call-template name="PrintAViewDimKeyClause">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewDimRefClause'">
<xsl:call-template name="PrintAViewDimRefClause">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
<xsl:with-param name="PntDoPrettyPrint" select="$PntDoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewDimHiers'">
<xsl:call-template name="PrintAViewDimHiers">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewMeasList'">
<xsl:call-template name="PrintAViewMeasList">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewMeas'">
<xsl:call-template name="PrintAViewMeas">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
<xsl:with-param name="PntDoPrettyPrint" select="$PntDoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewDfltMeas'">
<xsl:call-template name="PrintAViewDfltMeas">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewCacheMeas'">
<xsl:call-template name="PrintAViewCacheMeas">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintAViewCacheLvls'">
<xsl:call-template name="PrintAViewCacheLvls">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$BlockName='PrintADimJoinPath'">
<xsl:call-template name="PrintADimJoinPath">
<xsl:with-param name="DoPrettyPrint" select="$DoPrettyPrint"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- Print CLASSIFICATIONS -->
<xsl:template name="PrintClsfns">
<xsl:param name="IndentSize"/>
<xsl:for-each select="CLSFCTN_LIST/CLSFCTN_LIST_ITEM">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintClsfn'"/>
<xsl:with-param name="IndentSize" select="$IndentSize"/>
</xsl:call-template>
</xsl:for-each> <!-- classification list -->
</xsl:template>
<!-- Print ATTRIBUTE DIMENSION -->
<xsl:template match="ATTRIBUTE_DIM_T">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintObjHeader'"/>
</xsl:call-template>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>DIMENSION TYPE </xsl:text>
<xsl:value-of select="DIMENSION_TYPE"/>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimUsing'"/>
</xsl:call-template>
<xsl:for-each select="JOIN_PATH_LIST/JOIN_PATH_LIST_ITEM">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimJoinPath'"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimAttrs'"/>
</xsl:call-template>
<xsl:for-each select="LVL_LIST/LVL_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="1"/>
<xsl:with-param name="Pos" select="position()"/>
</xsl:call-template>
<xsl:text>LEVEL </xsl:text>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
<xsl:if test="SKIP_WHEN_NULL='Y'">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>SKIP WHEN NULL</xsl:text>
</xsl:if>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:text>LEVEL TYPE </xsl:text>
<xsl:value-of select="LEVEL_TYPE"/>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:for-each select="KEY_LIST/KEY_LIST_ITEM">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimLvlKey'"/>
</xsl:call-template>
</xsl:for-each> <!-- key list -->
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimLvlMbrName'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimLvlMbrCaption'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimLvlMbrDesc'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimLvlOrds'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimLvlDtms'"/>
</xsl:call-template>
</xsl:for-each> <!-- level list -->
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimAllMbrName'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimAllMbrCaption'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintADimAllMbrDesc'"/>
</xsl:call-template>
<xsl:if test="$SQLTERMINATOR=1">
<xsl:text>;</xsl:text>
</xsl:if>
</xsl:template>
<!-- Print HIERARCHY -->
<xsl:template match="HIER_T">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintObjHeader'"/>
</xsl:call-template>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintHierUsing'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintHierLvls'"/>
</xsl:call-template>
<xsl:if test="JOIN_PATH_LIST/JOIN_PATH_LIST_ITEM">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>JOIN USING</xsl:text>
<xsl:for-each select="JOIN_PATH_LIST/JOIN_PATH_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
</xsl:call-template>
<xsl:call-template name="QuoteObject">
<xsl:with-param name="Object" select="NAME"/>
</xsl:call-template>
</xsl:for-each>
</xsl:if>
<xsl:if test="HR_ATTR_LIST/HR_ATTR_LIST_ITEM">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>HIERARCHICAL ATTRIBUTES (</xsl:text>
<xsl:for-each select="HR_ATTR_LIST/HR_ATTR_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
</xsl:call-template>
<xsl:value-of select="NAME"/>
<xsl:if test="EXPR">
<xsl:text> AS (</xsl:text>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="3"/>
<xsl:with-param name="DoNonPrettySep" select="0"/>
</xsl:call-template>
<xsl:value-of select="EXPR"/>
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="3"/>
</xsl:call-template>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:if test="$SQLTERMINATOR=1">
<xsl:text>;</xsl:text>
</xsl:if>
</xsl:template>
<!-- Print ANALYTIC VIEW -->
<xsl:template match="ANALYTIC_VIEW_T">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintObjHeader'"/>
</xsl:call-template>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewUsing'"/>
</xsl:call-template>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>DIMENSION BY (</xsl:text>
<xsl:for-each select="DIM_LIST/DIM_LIST_ITEM">
<xsl:call-template name="PrintListSep">
<xsl:with-param name="IndentSize" select="2"/>
<xsl:with-param name="Pos" select="position()"/>
<xsl:with-param name="BeforeSep" select="','"/>
<xsl:with-param name="IsParenList" select="1"/>
</xsl:call-template>
<xsl:call-template name="PrintSchemaObj">
<xsl:with-param name="OwnerInDDL" select="OWNER_IN_DDL"/>
<xsl:with-param name="ObjName" select="NAME"/>
<xsl:with-param name="ObjOwner" select="DIM_OWNER"/>
</xsl:call-template>
<xsl:text> AS </xsl:text>
<xsl:call-template name ="QuoteObject">
<xsl:with-param name="Object" select="DIM_ALIAS"/>
</xsl:call-template>
<xsl:call-template name="PrintClsfns">
<xsl:with-param name="IndentSize" select="3"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewDimKey'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewDimHiers'"/>
</xsl:call-template>
</xsl:for-each> <!-- dimension list -->
<xsl:text>)</xsl:text>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewMeasList'"/>
</xsl:call-template>
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewDfltMeas'"/>
</xsl:call-template>
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>DEFAULT AGGREGATE BY </xsl:text>
<xsl:value-of select="DEF_AGGR"/>
<xsl:if test="($VERSION>=1202000200 and DYN_ALL_CACHE=1) or
CACHE_MEAS_LIST/CACHE_MEAS_LIST_ITEM">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="1"/>
</xsl:call-template>
<xsl:text>CACHE</xsl:text>
</xsl:if>
<xsl:if test="$VERSION>=1202000200 and DYN_ALL_CACHE=1">
<xsl:call-template name="PrintNLIndent">
<xsl:with-param name="IndentSize" select="2"/>
</xsl:call-template>
<xsl:if test="DYN_ALL_CACHE=0">
<xsl:text>NOT </xsl:text>
</xsl:if>
<xsl:text>DYNAMIC ACROSS ALL LEVELS</xsl:text>
</xsl:if>
<xsl:for-each select="CACHE_MEAS_LIST/CACHE_MEAS_LIST_ITEM">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewCacheMeas'"/>
</xsl:call-template>
<xsl:for-each select="LVLGRP_LIST/LVLGRP_LIST_ITEM">
<xsl:call-template name="PrintWrapBlock">
<xsl:with-param name="BlockName" select="'PrintAViewCacheLvls'"/>
</xsl:call-template>
</xsl:for-each> <!-- lvlgrp list -->
</xsl:for-each> <!-- cache meas list -->
<xsl:if test="$SQLTERMINATOR=1">
<xsl:text>;</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
OHA YOOOO