12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?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).
- -->
- <!-- this transform simply gets rid of the Cognos namespace -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:x="x">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <commandBlocks>
- <xsl:for-each select="/input/commandBlocks/command">
- <xsl:element name="command">
- <xsl:copy-of select="./*"/>
- <xsl:variable name="propertyName" select="propertyName"/>
- <xsl:variable name="commandCleared" select="/input/env/param[@name='actionOnCommands']='clear' and /input/env/param[starts-with(@name,'list_checkbox_')]=$propertyName"/>
- <xsl:variable name="commandReset" select="/input/env/param[@name='actionOnCommands']='reset' and /input/env/param[starts-with(@name,'list_checkbox_')]=$propertyName"/>
- <xsl:variable name="commandChanged" select="/input/env/param[@name=concat('changed_m_cbp_edit_',$propertyName)]='1'"/>
- <xsl:element name="value">
- <xsl:choose>
- <xsl:when test="$commandCleared"/>
- <xsl:when test="$commandReset">
- <xsl:value-of select="xtsext:xmldecode(string(/input/parentCommands/*[local-name()=$propertyName]))"/>
- </xsl:when>
- <!-- if we came from the set command dialog -->
- <xsl:when test="/input/env/param[@name=concat('m_cbp_edit_', $propertyName)]">
- <xsl:value-of select="/input/env/param[@name=concat('m_cbp_edit_', $propertyName)]"/>
- </xsl:when>
- <xsl:when test="/input/env/param[@name=concat('m_cbp_', $propertyName)]">
- <xsl:value-of select="/input/env/param[@name=concat('m_cbp_', $propertyName)]"/>
- </xsl:when>
- <xsl:when test="/input/currentCommands/*[local-name()=$propertyName]">
- <xsl:value-of select="xtsext:xmldecode(string(/input/currentCommands/*[local-name()=$propertyName]))"/>
- </xsl:when>
- <xsl:when test="/input/parentCommands/*[local-name()=$propertyName]!=''">
- <xsl:value-of select="xtsext:xmldecode(string(/input/parentCommands/*[local-name()=$propertyName]))"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="changed">
- <xsl:choose>
- <xsl:when test="$commandChanged or $commandCleared or $commandReset">1</xsl:when>
- <xsl:when test="/input/env/param[@name=concat('changed_m_cbp_',$propertyName)]">
- <xsl:value-of select="/input/env/param[@name=concat('changed_m_cbp_',$propertyName)]"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="acquired">
- <xsl:choose>
- <xsl:when test="$commandReset">true</xsl:when>
- <xsl:when test="$commandCleared or $commandChanged">false</xsl:when>
- <xsl:when test="/input/env/param[@name=concat('m_acquired_', $propertyName)]">
- <xsl:value-of select="/input/env/param[@name=concat('m_acquired_', $propertyName)]"/>
- </xsl:when>
- <!-- if we're creating a new connection then by default the values are acquired -->
- <xsl:when test="/input/env/param[@name='m_new_class']='dataSourceConnection'">true</xsl:when>
- <xsl:when test="/input/currentCommands/*[local-name()=$propertyName][@acquired='true']">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </commandBlocks>
- </xsl:template>
- </xsl:stylesheet>
|