gen-standard-list.xslt 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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, 2012
  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 change a CM response into the same structure returned by add recipients. This is used
  14. to create a <selectedEntries> node from the bus:mobileOptionSearchPathMultipleObjectArray that holds
  15. the list of mobile recipients.
  16. -->
  17. <xsl:stylesheet version="1.0"
  18. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  20. exclude-result-prefixes="xsl xts">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/root" priority="2">
  23. <xsl:variable name="unknownText" select="*[local-name()='unknownText']"/>
  24. <xsl:for-each select="*[local-name()='queryResponse']/*[local-name()='queryReply']">
  25. <xsl:variable name="searchPath" select="*/*[local-name()='searchPath']"/>
  26. <xsl:variable name="class" select="*/*[local-name()='objectClass']"/>
  27. <xsl:variable name="position" select="position()"/>
  28. <!-- only add the entry if we got something back from CM -->
  29. <xsl:choose>
  30. <xsl:when test="$searchPath != ''">
  31. <!-- recipients for mobile can be of type account, group, role or contact. Use the
  32. object class as the name for the element -->
  33. <xsl:element name="{$class}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  34. <searchPath>
  35. <xsl:value-of select="$searchPath"/>
  36. </searchPath>
  37. <userName>
  38. <xsl:value-of select="*/*[local-name()='userName']"/>
  39. </userName>
  40. <defaultName>
  41. <xsl:value-of select="*/*[local-name()='defaultName']"/>
  42. </defaultName>
  43. <objectClass>
  44. <xsl:value-of select="$class"/>
  45. </objectClass>
  46. <xsl:copy-of select="*/*[local-name()='ancestors']"/>
  47. <type>to</type>
  48. </xsl:element>
  49. </xsl:when>
  50. <xsl:otherwise>
  51. <group xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  52. <searchPath/>
  53. <userName/>
  54. <defaultName><xsl:value-of select="$unknownText"/></defaultName>
  55. <objectClass/>
  56. </group>
  57. </xsl:otherwise>
  58. </xsl:choose>
  59. </xsl:for-each>
  60. </xsl:template>
  61. <xsl:template match="text()" priority="0"/>
  62. </xsl:stylesheet>