12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?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).
- -->
- <!--
- NOTE: The logic to determine the order of the queries MUST match the logic found in dt:generateInitialUIHelpers
- if checkUIHelpers is true, then only build the CM query if the associated UIHelper is empty.
- -->
- <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">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="*[local-name()='root']" priority="1">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="*[local-name()='searchPath']" priority="1">
- <xsl:element name="{name()}" namespace="{namespace-uri()}">
- <xsl:copy-of select="@*"/>
- <xsl:variable name="parentPos" select="count(parent::*/parent::*/preceding-sibling::*)+1"/>
- <xsl:value-of select="/root/*[local-name()='queryBuiltFromOptions']/*[local-name()='query'][position()=$parentPos]/*[local-name()='search']"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="*[local-name()='queryBuiltFromOptions']" priority="1"/>
-
- <!-- match all unmatched nodes -->
- <xsl:template match="node()" priority="0">
- <xsl:element name="{name()}" namespace="{namespace-uri()}">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
- <!-- copy just the text -->
- <xsl:template match="text()" priority="0">
- <xsl:copy-of select="."/>
- </xsl:template>
- </xsl:stylesheet>
|