12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <!-- input
- <root>
- <oldEntries></oldEntries>
- <newEntries></newEntries>
- <allowDuplicates>false</allowDuplicates>
- <trackNewEntries paramName="..." property="..."/>
- </root>
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- exclude-result-prefixes="xsl cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/root" priority="1">
- <!-- copy all the old entries -->
- <xsl:copy-of select="/root/oldEntries/*"/>
-
- <xsl:choose>
- <xsl:when test="/root/allowDuplicates = 'false'">
- <xsl:for-each select="/root/newEntries/*">
- <xsl:variable name="searchPath" select="*[local-name()='searchPath']"/>
- <xsl:if test="not(*[local-name()='searchPath'] = /root/oldEntries/*/*[local-name()='searchPath'])">
- <xsl:element name="{local-name()}" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="*"/>
- </xsl:element>
- <xsl:if test="/root/trackNewEntries">
- <param name="{/root/trackNewEntries/@paramName}">
- <xsl:variable name="prop" select="/root/trackNewEntries/@property"/>
- <xsl:if test="$prop != ''">
-
- <xsl:value-of select="*[local-name()=$prop]"/>
- </xsl:if>
- </param>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/newEntries/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|