RSUpgradeSchema.xsl 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. * Produces a v5 report specification with a schema location to the report
  14. * can be validated. Input is a v5 report specification.
  15. *
  16. * Used for testing only, since report studio will reject reports with
  17. * the schema directive.
  18. *
  19. -->
  20. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:baltic="http://developer.cognos.com/schemas/report/1/" xmlns:bering="http://developer.cognos.com/schemas/report/2.0/" xmlns="http://developer.cognos.com/schemas/report/2.0/" xmlns:date="http://exslt.org/dates-and-times" xmlns:exsl="http://exslt.org/common" xmlns:xalan="http://xml.apache.org/xalan" xmlns:java="http://xml.apache.org/xalan/java" xmlns:qfw="java:com.qfw.V4toV5.V4toV5QuerySet" extension-element-prefixes="xalan java date exsl qfw" exclude-result-prefixes="xalan java baltic date exsl qfw">
  21. <xsl:output method="xml"/>
  22. <!-- URI where the schema is located. -->
  23. <xsl:param name="p_schemaLocation_uri" select="'ERROR p_schemaLocation_uri must be defined.'"/>
  24. <xsl:template match="/bering:report">
  25. <bering:report>
  26. <xsl:attribute name="xmlns:xsi">http://www.w3.org/2001/XMLSchema-instance</xsl:attribute>
  27. <xsl:attribute name="xsi:schemaLocation">http://developer.cognos.com/schemas/report/2.0/ <xsl:value-of select="$p_schemaLocation_uri"/></xsl:attribute>
  28. <xsl:for-each select="@*">
  29. <xsl:copy-of select="."/>
  30. </xsl:for-each>
  31. <xsl:apply-templates/>
  32. </bering:report>
  33. </xsl:template>
  34. <!-- Copy anything that is unmatched over to output. -->
  35. <xsl:template match="@*|node()">
  36. <xsl:copy>
  37. <xsl:apply-templates select="@*|node()"/>
  38. </xsl:copy>
  39. </xsl:template>
  40. </xsl:stylesheet>