12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2008
- 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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="*">
- <xsl:apply-templates select="options" mode="copy"/>
- </xsl:template>
- <xsl:template match="*" mode="copy">
- <xsl:choose>
- <xsl:when test="local-name()='item' and attribute::*[local-name()='type']='bus:memoPartAgentObject' ">
- <!-- do we need to copy this - is there an attachment for it -->
- <xsl:variable name="attachmentSearchPath" select="./*[local-name()='searchPath']"/>
- <xsl:if test="/root/memo/attachment[./attachmentSearchPath=$attachmentSearchPath]/item/searchPath!='' ">
- <xsl:call-template name="copyNode"/>
- </xsl:if>
- </xsl:when>
- <xsl:when test="local-name()='item' and attribute::*[local-name()='type']='bus:objectLink' ">
- <!-- do we need to copy this - is there a link for it -->
- <xsl:variable name="linkSearchPath" select="./*[local-name()='searchPath']"/>
- <xsl:if test="/root/memo/link[./linkSearchPath=$linkSearchPath]/item/searchPath!='' ">
- <xsl:call-template name="copyNode"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="copyNode"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="copyNode">
- <xsl:copy>
- <!-- copy all the attributes across -->
- <xsl:copy-of select="@*"/>
- <!-- decide if we need to add the selectAll element or not attribute -->
- <xsl:for-each select="node()">
- <xsl:apply-templates mode="copy" select="."/>
- </xsl:for-each>
- </xsl:copy>
- </xsl:template>
- <!-- -->
- <xsl:template match="text()" mode="copy">
- <xsl:param name="name"/>
- <xsl:value-of select="."/>
- </xsl:template>
- </xsl:stylesheet>
|