12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?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).
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl cm xts">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:apply-templates/>
- </xsl:template>
- <!-- Separate standard parameters from credential parameters -->
- <xsl:template match="*[local-name()='parameters']">
- <xsl:if test="*[local-name()='parameterValue'][not(starts-with(*[local-name()='name'], 'credential:'))]">
- <parameters>
- <!-- Simply copy all the non-credential parameters -->
- <xsl:apply-templates select="*[local-name()='parameterValue'][not(starts-with(*[local-name()='name'], 'credential:'))]" mode="copy"/>
- </parameters>
- </xsl:if>
- <!-- if we have credential parameters -->
- <xsl:if test="*[local-name()='parameterValue'][starts-with(*[local-name()='name'], 'credential:')]">
- <credentialParameters>
- <xsl:value-of select="*[local-name()='parameterValue'][starts-with(*[local-name()='name'], 'credential:')]/*/*[local-name()='display']" disable-output-escaping="yes"/>
- </credentialParameters>
- </xsl:if>
- </xsl:template>
- <!-- XSLTC workaround: For some reason, I cannot copy the nodes directly without getting an ArrayIndexOutOfBoundsException -->
- <xsl:template match="*" mode="copy">
- <xsl:copy>
- <xsl:copy-of select="@*|text()"/>
- <xsl:apply-templates select="*" mode="copy"/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="*">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="text()"/>
- </xsl:stylesheet>
|