xform_54to55.xsl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: fmmd
  5. (C) Copyright IBM Corp. 2003, 2013
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <!--
  10. ===============================================================================
  11. Model Upgrade 54 to 55 Notes:
  12. This is an XSLT transformation from a Bering schema version 54 model to a Bering
  13. schema version 55 model.
  14. This Upgrade is required to accomodate the following Model Schema changes.
  15. * Move the role names introduced in schema 54 into a role container
  16. ============================================================================================ -->
  17. <xsl:stylesheet xmlns="http://www.developer.cognos.com/schemas/bmt/55/0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  18. <xsl:include href="fmmd_generalTemplates.xsl"/>
  19. <xsl:strip-space elements="*"/>
  20. <xsl:output encoding="utf-8" method="xml" indent="no"/>
  21. <!-- Template: Move the role names into a role container -->
  22. <xsl:template match="*[local-name()='roles']/*[local-name()='name']">
  23. <!-- Insert a role element -->
  24. <xsl:element name="role">
  25. <!-- Annotate it-->
  26. <xsl:call-template name="annotate">
  27. <xsl:with-param name="value" select="$strAddingRole"/>
  28. </xsl:call-template>
  29. <!-- Copy -->
  30. <xsl:call-template name="myCopy"/>
  31. </xsl:element>
  32. </xsl:template>
  33. <!-- Globlal variables-->
  34. <xsl:variable name="sEmptyNamespace" select="string(document('')/*/namespace::*[name()=''])"/>
  35. <xsl:variable name="nNewSchema" select="number(substring-before(substring-after($sEmptyNamespace, 'http://www.developer.cognos.com/schemas/bmt/'), '/'))"/>
  36. <xsl:variable name="nOldSchema" select="$nNewSchema - 1"/>
  37. <xsl:variable name="strAddingRole">
  38. <xsl:call-template name="getLocalizedString">
  39. <xsl:with-param name="stringID" select="$MODELUPGRADE_ADDING_ROLE"/>
  40. <xsl:with-param name="localeVal" select="$defaultLocale"/>
  41. </xsl:call-template>
  42. </xsl:variable>
  43. </xsl:stylesheet>