1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?xml version="1.0"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: fmmd
- (C) Copyright IBM Corp. 2003, 2013
- US Government Users Restricted Rights - Use, duplication or disclosure
- restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- ===============================================================================
- Model Upgrade 58 to 59 Notes:
- This is an XSLT transformation from a Bering schema version 58 model to a Blacksea
- schema version 59 model
- This Upgrade is required to accomodate the following Model Schema changes made in Bering:
- * Lightweight models now require an indicator on the project identifying them as such.
- * Switch all 'embedded' externalize methods to 'default'.
- ===============================================================================
- -->
- <xsl:stylesheet xmlns="http://www.developer.cognos.com/schemas/bmt/59/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" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="fmfunc xalan">
- <xsl:include href="fmmd_generalTemplates.xsl"/>
- <xsl:strip-space elements="*"/>
- <xsl:output encoding="utf-8" method="xml" indent="no"/>
- <!-- =============================================================================== -->
- <!-- Step 1: Models missing a datasource object are assumed to contain lightweight
- OLAP models.
- NOTE: Override the template in the fmmd_generalTemplates.xsl
- -->
- <!-- Template: Update the schema version-->
- <xsl:template match="/*[local-name()='project'] ">
- <xsl:element name="project" namespace="{$sEmptyNamespace}">
- <xsl:if test="not(/*[local-name()='project']/*[local-name()='dataSources']/*[local-name()='dataSource'])">
- <xsl:attribute name="useMFW">true</xsl:attribute>
- </xsl:if>
- <xsl:for-each select="@*">
- <xsl:choose>
- <!-- Update the schema # -->
- <xsl:when test="name(.) = 'xsi:schemaLocation'">
- <xsl:attribute name="{name(.)}"><xsl:value-of select="concat($sEmptyNamespace, ' BMTModelSpecification.xsd')"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:apply-templates select="node()"/>
- </xsl:element>
- </xsl:template>
- <!-- =============================================================================== -->
- <!-- Step 2: Switch all 'embedded' externalize methods to 'default'.
- The 'embedded' externalize method has been deprecated.
- -->
- <xsl:template match="*[local-name()='querySubject']/*[local-name()='externalizeMethod']/text()">
- <xsl:choose>
- <xsl:when test=". = 'embedded'">default</xsl:when>
- <xsl:otherwise>
- <xsl:copy/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- =============================================================================== -->
- <!-- Global variables: -->
- <!-- =============================================================================== -->
- <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>
|