buildParameterValues.xslt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: Viewer
  5. (C) Copyright IBM Corp. 2001, 2011
  6. US Government Users Restricted Rights - Use, duplication or
  7. disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  10. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  12. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  13. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  14. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  15. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  16. xmlns:sl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/prmt/soaplogic/">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  18. <sl:soaplogic/>
  19. <xsl:template match="/*[local-name()='selectChoicesSpecification']/*[local-name()='PromptValues']">
  20. <root>
  21. <PromptValues>
  22. <xsl:for-each select="./*[local-name()='PromptValue']">
  23. <PromptValue>
  24. <xsl:for-each select="@*">
  25. <xsl:attribute name="{name()}">
  26. <xsl:value-of select="."/>
  27. </xsl:attribute>
  28. </xsl:for-each>
  29. <xsl:for-each select="*[local-name()='selectChoices']">
  30. <selectChoices>
  31. <xsl:for-each select="./*">
  32. <xsl:element name="{name()}">
  33. <xsl:for-each select="@*[not(name()='useValue' or name()='mun')]">
  34. <xsl:attribute name="{name()}">
  35. <xsl:value-of select="."/>
  36. </xsl:attribute>
  37. </xsl:for-each>
  38. <xsl:choose>
  39. <xsl:when test="string(./@mun)!=''">
  40. <xsl:attribute name="useValue"><xsl:value-of select="./@mun"/></xsl:attribute>
  41. </xsl:when>
  42. <xsl:otherwise>
  43. <xsl:attribute name="useValue"><xsl:value-of select="./@useValue"/></xsl:attribute>
  44. </xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:element>
  47. </xsl:for-each>
  48. </selectChoices>
  49. </xsl:for-each>
  50. </PromptValue>
  51. </xsl:for-each>
  52. </PromptValues>
  53. </root>
  54. </xsl:template>
  55. <xsl:template match="*[local-name()='root']">
  56. <xsl:call-template name="SetParameters"/>
  57. </xsl:template>
  58. </xsl:stylesheet>