RSUpgradeAnnotateLayout.xsl 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: rspecupgrade
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <!-- COPYRIGHT_DATA { 'YEAR':[2005, 2009], 'RELEASE':['colorado_wave1'], 'VISIBLE':'YES', 'COMPONENT':'rspecupgrade' }-->
  10. <!--All lines above the COPYRIGHT_DATA line will be replaced when copyright notices are generated. -->
  11. <!--
  12. *
  13. * This stylesheet annotates elements of the V5 report layout.
  14. *
  15. * Currently, the only annotation is that of a unique name attribute on the
  16. * crosstab/defaultMeasure and crosstabNodeMember elements.
  17. * This is done as part of the implementation of WO1713 and WO1730.
  18. *
  19. * The name attribute is used as the name attribute of the valueSets generated
  20. * by the RSUpgradeResultSetSqueleton stylesheet. This is so we can map QRD valueSets
  21. * back to their corresponding layout elements in the v5 to v5 upgrade.
  22. *
  23. -->
  24. <xsl:stylesheet version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:v5="http://developer.cognos.com/schemas/report/2.0/" xmlns="http://developer.cognos.com/schemas/report/2.0/" exclude-result-prefixes="xsl fo xs">
  25. <xsl:output method="xml" encoding="utf-8"/>
  26. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  27. <!-- Generate a unique name attribute for each crosstab/defaultMeasure. -->
  28. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  29. <xsl:template match="v5:defaultMeasure">
  30. <xsl:copy>
  31. <xsl:attribute name="name">
  32. <xsl:value-of select="generate-id(@refDataItem)"/>
  33. </xsl:attribute>
  34. <xsl:apply-templates select="@*|node()"/>
  35. </xsl:copy>
  36. </xsl:template>
  37. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  38. <!-- Generate a unique name attribute for each crosstabNodeMember. -->
  39. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  40. <xsl:template match="v5:crosstabNodeMember">
  41. <xsl:copy>
  42. <xsl:attribute name="name">
  43. <xsl:value-of select="generate-id(.)"/>
  44. </xsl:attribute>
  45. <xsl:apply-templates select="@*|node()"/>
  46. </xsl:copy>
  47. </xsl:template>
  48. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  49. <!-- Copy all nodes and attributes by default. -->
  50. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  51. <xsl:template match="@*|node()">
  52. <xsl:copy>
  53. <xsl:apply-templates select="@*|node()"/>
  54. </xsl:copy>
  55. </xsl:template>
  56. </xsl:stylesheet>