buildOptions.xslt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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:cm="http://developer.cognos.com/schemas/bibus/3/"
  14. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  15. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  18. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  19. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  20. exclude-result-prefixes="cm xsd xsi xsl xts SOAP-ENC bus">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/root" priority="1">
  23. <xsl:choose>
  24. <xsl:when test="not(@mode) or @mode='save'">
  25. <options xmlns="" xsi:type="bus:optionArrayProp">
  26. <value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[{count(*[local-name()='item'])}]">
  27. <xsl:copy-of select="*[local-name()='item']"/>
  28. </value>
  29. </options>
  30. </xsl:when>
  31. <xsl:otherwise>
  32. <options xmlns="" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[{count(*[local-name()='item'])}]">
  33. <xsl:copy-of select="*[local-name()='item']"/>
  34. </options>
  35. </xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:template>
  38. </xsl:stylesheet>