contentLogic.xslt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. *****************************************************************
  4. ** Licensed Materials - Property of IBM
  5. **
  6. ** IBM Cognos Products: drill
  7. **
  8. ** (C) Copyright IBM Corp. 2001, 2010
  9. **
  10. ** US Government Users Restricted Rights - Use, duplication or
  11. ** disclosure restricted by GSA ADP Schedule Contract with
  12. ** IBM Corp.
  13. *****************************************************************
  14. -->
  15. <!--
  16. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  17. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  18. -->
  19. <xsl:stylesheet version="1.0"
  20. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  21. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  22. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  23. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  24. xmlns:pm="http://developer.cognos.com/schemas/xts/pm"
  25. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  26. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  27. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  28. exclude-result-prefixes="xsl send bus xts xtsext pf cm pm">
  29. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  30. <xsl:template match="root">
  31. <promptRequest>
  32. <collectResponse xmlns="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/">
  33. <xsl:apply-templates select="/root/*[local-name()='promptRequest']/*/*[local-name()='parameters']" mode="pam"/>
  34. </collectResponse>
  35. </promptRequest>
  36. </xsl:template>
  37. <xsl:template match="/root/*[local-name()='promptRequest']/*/*[local-name()='parameters']" mode="pam">
  38. <xsl:copy>
  39. <xsl:copy-of select="./@*"/>
  40. <xsl:apply-templates select="./*" mode="item"/>
  41. </xsl:copy>
  42. </xsl:template>
  43. <xsl:template match="*[local-name()='item']" mode="item">
  44. <xsl:variable name="pos" select="position()"/>
  45. <xsl:copy>
  46. <xsl:copy-of select="./*"/>
  47. <position xmlns="http://developer.cognos.com/schemas/bibus/3/"><xsl:value-of select="$pos"/></position>
  48. </xsl:copy>
  49. </xsl:template>
  50. </xsl:stylesheet>