encode_selected_entries.xslt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. Transform used to web64encode the <selectedEntries> node.
  14. -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  18. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  22. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  23. exclude-result-prefixes="xsl dlgctrl xtsext pf">
  24. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  25. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  26. <pf:serialize-xml/>
  27. <xsl:template match="/">
  28. <xsl:if test="/root/selectedEntries/*">
  29. <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  30. <xts:sequence>
  31. <xsl:variable name="selectedEntries">
  32. <xsl:call-template name="serialize-xml">
  33. <xsl:with-param name="node-set" select="/root/selectedEntries/*"/>
  34. </xsl:call-template>
  35. </xsl:variable>
  36. <xts:delete select="/root/env/param[@name='selectedEntries']"/>
  37. <xts:append select="/root/env">
  38. <param name="selectedEntries">
  39. <xsl:if test="$selectedEntries!=''">
  40. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode( string( $selectedEntries ), true()))"/>
  41. </xsl:if>
  42. </param>
  43. </xts:append>
  44. </xts:sequence>
  45. </xsl:if>
  46. </xsl:template>
  47. </xsl:stylesheet>