xform_51to52.xsl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 51 to 52 Notes:
  12. This is an XSLT transformation from a Bering schema version 51 model to a Bering
  13. schema version 52 model.
  14. This Upgrade is required to accomodate the following Model Schema changes.
  15. * The hierarchy "network" property for has been removed and has been instead replaced with the property "parentChild".
  16. ===============================================================================
  17. -->
  18. <xsl:stylesheet xmlns="http://www.developer.cognos.com/schemas/bmt/52/0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  19. <xsl:include href="fmmd_generalTemplates.xsl"/>
  20. <xsl:strip-space elements="*"/>
  21. <xsl:output encoding="utf-8" method="xml" indent="no"/>
  22. <!-- Template: Replace the hierarchy 'network' property introduced in schema 51 with the new 'parentChild' property -->
  23. <xsl:template match="*[local-name()='hierarchy']/*[local-name()='network']">
  24. <!-- The parentChild property is of type boolean and set to false for upgraded models -->
  25. <xsl:element name="parentChild">false</xsl:element>
  26. </xsl:template>
  27. <!-- Globlal variables-->
  28. <xsl:variable name="sEmptyNamespace" select="string(document('')/*/namespace::*[name()=''])"/>
  29. <xsl:variable name="nNewSchema" select="number(substring-before(substring-after($sEmptyNamespace, 'http://www.developer.cognos.com/schemas/bmt/'), '/'))"/>
  30. <xsl:variable name="nOldSchema" select="$nNewSchema - 1"/>
  31. </xsl:stylesheet>