build-subscription.xslt 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  15. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  16. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  17. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  19. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  20. exclude-result-prefixes="xsd xsi bus cm">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <!-- global variables -->
  23. <xsl:variable name="xtscm" select="'http://developer.cognos.com/schemas/xts-cm/1/'"/>
  24. <xsl:variable name="xsd-prefix" select="'xsd'"/>
  25. <!-- main entry point -->
  26. <xsl:template match="/">
  27. <xsl:apply-templates/>
  28. </xsl:template>
  29. <xsl:template match="cm:queryResponse" priority="1">
  30. <xsl:element name="queryResponse" namespace="{$xtscm}">
  31. <xsl:copy-of select="./cm:queryReply[1]"/>
  32. <xsl:copy-of select="./cm:queryReply[2]"/>
  33. <xsl:element name="queryReply" namespace="{$xtscm}">
  34. <xsl:apply-templates select="./cm:queryReply[3]/*"/>
  35. </xsl:element>
  36. <xsl:element name="queryReply" namespace="{$xtscm}">
  37. <xsl:apply-templates select="./cm:queryReply[4]/*" mode="type"/>
  38. </xsl:element>
  39. </xsl:element>
  40. </xsl:template>
  41. <xsl:template match="cm:schedule">
  42. <xsl:element name="reportDataServiceAgentDefinition" namespace="{$xtscm}">
  43. <xsl:element name="objectClass" namespace="{$xtscm}">reportDataServiceAgentDefinition</xsl:element>
  44. <xsl:copy-of select="./cm:parent/cm:reportDataServiceAgentDefinition/cm:searchPath"/>
  45. <xsl:copy-of select="./cm:parent/cm:reportDataServiceAgentDefinition/cm:defaultName"/>
  46. <xsl:copy-of select="./cm:parent/cm:reportDataServiceAgentDefinition/cm:permissions"/>
  47. <xsl:copy-of select="./cm:parent/cm:reportDataServiceAgentDefinition/cm:storeID"/>
  48. <xsl:copy-of select="./cm:parent/cm:reportDataServiceAgentDefinition/cm:defaultScreenTip"/>
  49. <xsl:copy-of select="./cm:periodicalProducer"/>
  50. <xsl:copy-of select="./cm:position"/>
  51. <xsl:copy-of select="./cm:active"/>
  52. <xsl:copy-of select="./cm:parent/cm:reportDataServiceAgentDefinition/cm:hidden"/>
  53. </xsl:element>
  54. </xsl:template>
  55. <xsl:template match="cm:subscriptionFolder">
  56. <xsl:copy-of select="."/>
  57. </xsl:template>
  58. <xsl:template match="cm:schedule" mode="type"/>
  59. <xsl:template match="*" mode="type">
  60. <xsl:if test="string(.//cm:objectClass) != 'agentTaskDefinition'">
  61. <xsl:copy-of select=".//cm:objectClass"/>
  62. </xsl:if>
  63. </xsl:template>
  64. </xsl:stylesheet>