jobSetSequence.xslt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. NOTE: The logic to determine the order of the queries MUST match the logic found in dt:generateInitialUIHelpers
  14. if checkUIHelpers is true, then only build the CM query if the associated UIHelper is empty.
  15. -->
  16. <xsl:stylesheet version="1.0"
  17. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  18. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  19. exclude-result-prefixes="xsl">
  20. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  21. <xsl:template match="/root" priority="1">
  22. <steps>
  23. <xsl:apply-templates/>
  24. </steps>
  25. </xsl:template>
  26. <xsl:template match="*[local-name()='queryResponse']" priority="1">
  27. <xsl:copy>
  28. <xsl:copy-of select="@*"/>
  29. <xsl:for-each select="*[local-name()='jobStepDefinition']">
  30. <xsl:copy>
  31. <xsl:copy-of select="@*"/>
  32. <xsl:apply-templates/>
  33. <xsl:element name="displaySequence" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  34. <xsl:value-of select="position()"/>
  35. </xsl:element>
  36. </xsl:copy>
  37. </xsl:for-each>
  38. </xsl:copy>
  39. </xsl:template>
  40. <xsl:template match="*[local-name()='displaySequence']" priority="1"/>
  41. <!-- match all unmatched nodes -->
  42. <xsl:template match="node()" priority="0">
  43. <xsl:element name="{name()}" namespace="{namespace-uri()}">
  44. <xsl:copy-of select="@*"/>
  45. <xsl:apply-templates/>
  46. </xsl:element>
  47. </xsl:template>
  48. <!-- copy just the text -->
  49. <xsl:template match="text()" priority="0">
  50. <xsl:copy-of select="."/>
  51. </xsl:template>
  52. </xsl:stylesheet>