updateSelectedEntries.xslt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. exclude-result-prefixes="xsl">
  15. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  16. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  17. <xsl:key name="nav-param" match="/root/env/param[starts-with(@name,'nav_checkbox')]" use="."/>
  18. <xsl:template match="/root" priority="1">
  19. <xsl:for-each select="/root/selectedEntries/*">
  20. <xsl:variable name="searchPathForURL" select="./*[local-name()='searchPathForURL']"/>
  21. <xsl:element name="{local-name()}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  22. <xsl:choose>
  23. <xsl:when test="position() &gt; key('env-param','pagerfromlistpager')-1 and position() &lt; key('env-param','pagertolistpager')+1">
  24. <xsl:copy-of select="*[local-name()!='type']"/>
  25. <xsl:for-each select="/root/env/param[contains(@name,'_type_checkbox') and string(.) = $searchPathForURL]">
  26. <type><xsl:value-of select="substring-before(@name,'_')"/></type>
  27. </xsl:for-each>
  28. </xsl:when>
  29. <xsl:otherwise>
  30. <xsl:copy-of select="*"/>
  31. </xsl:otherwise>
  32. </xsl:choose>
  33. </xsl:element>
  34. </xsl:for-each>
  35. </xsl:template>
  36. <xsl:template match="text()" priority="0"/>
  37. </xsl:stylesheet>