12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2012
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!--
- Transform used to change a CM response into the same structure returned by add recipients. This is used
- to create a <selectedEntries> node from the bus:mobileOptionSearchPathMultipleObjectArray that holds
- the list of mobile recipients.
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root" priority="2">
- <xsl:variable name="unknownText" select="*[local-name()='unknownText']"/>
- <xsl:for-each select="*[local-name()='queryResponse']/*[local-name()='queryReply']">
- <xsl:variable name="searchPath" select="*/*[local-name()='searchPath']"/>
- <xsl:variable name="class" select="*/*[local-name()='objectClass']"/>
- <xsl:variable name="position" select="position()"/>
- <!-- only add the entry if we got something back from CM -->
- <xsl:choose>
- <xsl:when test="$searchPath != ''">
- <!-- recipients for mobile can be of type account, group, role or contact. Use the
- object class as the name for the element -->
- <xsl:element name="{$class}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <searchPath>
- <xsl:value-of select="$searchPath"/>
- </searchPath>
- <userName>
- <xsl:value-of select="*/*[local-name()='userName']"/>
- </userName>
- <defaultName>
- <xsl:value-of select="*/*[local-name()='defaultName']"/>
- </defaultName>
- <objectClass>
- <xsl:value-of select="$class"/>
- </objectClass>
- <xsl:copy-of select="*/*[local-name()='ancestors']"/>
- <type>to</type>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <group xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <searchPath/>
- <userName/>
- <defaultName><xsl:value-of select="$unknownText"/></defaultName>
- <objectClass/>
- </group>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="text()" priority="0"/>
- </xsl:stylesheet>
|