123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xts xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="prev-recipient" match="/root/*[local-name()='previouslyAdded']/item/*[local-name()='searchPath']" use="."/>
-
- <xsl:template match="/root" priority="2">
- <!-- contacts -->
- <xsl:variable name="new_contact">
- <xsl:for-each select="/root/*[local-name()='selectedEntries']/*">
- <xsl:variable name="searchPath" select="*[local-name()='searchPath']"/>
- <xsl:if test="not(key('prev-recipient', $searchPath))">
- <xsl:variable name="displayName">
- <xsl:text/>
- <xsl:call-template name="createDisplayName">
- <xsl:with-param name="defaultName" select="*[local-name()='defaultName']"/>
- <xsl:with-param name="userName" select="*[local-name()='userName']"/>
- </xsl:call-template>
- <xsl:text/>
- </xsl:variable>
- <xsl:value-of select="concat($displayName,';')"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <param name="contact">
- <xsl:value-of select="concat($new_contact, /root/env/param[@name='contact'])"/>
- </param>
- <xsl:if test="key('prev-recipient', /root/*[local-name()='selectedEntries']/*/*[local-name()='searchPath'])">
- <param name="duplicateEntryAdded">true</param>
- </xsl:if>
- </xsl:template>
-
- <!-- build the value for the input field. Has the format of -->
- <xsl:template name="createDisplayName">
- <xsl:param name="userName" select="''"/>
- <xsl:param name="defaultName" select="''"/>
-
- <xsl:choose>
- <xsl:when test="$userName !=''">
- <xsl:text/>
- <xts:string id="IDS_EMAIL_DISPLAY_USER">
- <xts:param name="defaultName"><xsl:value-of select="$defaultName"/></xts:param>
- <xts:param name="userName"><xsl:value-of select="$userName"/></xts:param>
- </xts:string><xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$defaultName"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text()" priority="0"/>
- </xsl:stylesheet>
|