1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2013
- 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).
- Transforms the infromation from getContent and getTargetInformationBlocks to have complete information
- required to show the path to taget in one place.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:pm="http://developer.cognos.com/schemas/xts/pm" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl send bus xts xtsext pf cm pm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <queryReply>
- <xsl:for-each select="./*[local-name()='content']/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='package']">
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </queryReply>
- <queryReply>
- <xsl:for-each select="./*[local-name()='content']/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*[local-name()='drillPath' or local-name()='folder' or local-name()='package']">
- <xsl:choose>
- <xsl:when test="./*[local-name()='objectClass']='folder' or ./*[local-name()='objectClass']='package'">
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:when test="./*[local-name()='target']!=''">
- <xsl:copy-of select="."/>
- </xsl:when>
- <xsl:when test="./*[local-name()='deploymentReferences']/*[local-name()='deploymentReference']/*/*[local-name()='storeID']!=''">
- <drillPath>
- <xsl:variable name="storeID" select="./*[local-name()='deploymentReferences']/*[local-name()='deploymentReference']/*/*[local-name()='storeID']"/>
- <target type="cm:baseClassArrayProp" modifiable="true" searchable="false" acquirable="false" acquired="false">
- <xsl:copy-of select="/*[local-name()='content']/*[local-name()='targetInfo']/*[./*[local-name()='storeID' and string(.)=$storeID]][1]"/>
- </target>
- <xsl:apply-templates select="./*"/>
- </drillPath>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </queryReply>
- </xsl:template>
- <xsl:template match="@*|node()">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="cm:target">
- <!--We do nothing just remove the empy target which we have already replaced by a new target node-->
- </xsl:template>
- </xsl:stylesheet>
|