1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?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:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- exclude-result-prefixes="xsd xsi bus SOAP-ENC SOAP-ENV">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xsl:apply-templates select="SOAP-ENV:Body/bus:queryResponse"/>
- </xsl:template>
-
- <xsl:template match="bus:queryResponse">
- <xsl:apply-templates select="queryResult/item[1]/portalPages/value/* | queryResult/item/state"/>
- </xsl:template>
- <xsl:template match="item">
- <xsl:variable name="class" select="substring-after(@xsi:type, ':')"/>
- <xsl:element name="{$class}">
- <objectClass><xsl:value-of select="$class"/></objectClass>
- <xsl:apply-templates select="*[not(contains(@xsi:type, 'ArrayProp'))]"/>
- <xsl:if test="portalPages">
- <cm:portalPages>
- <xsl:apply-templates select="portalPages/value/item"/>
- </cm:portalPages>
- </xsl:if>
- <xsl:apply-templates select="permissions"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="*[not(contains(@xsi:type, 'ArrayProp'))]" priority="-99">
- <!-- simple properties -->
- <xsl:element name="{local-name()}" >
- <xsl:value-of select="value"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="permissions">
- <xsl:element name="permissions">
- <xsl:for-each select="value/item">
- <xsl:if test="position() > 1"><xsl:text> </xsl:text></xsl:if>
- <xsl:value-of select="."/>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="state">
- <xsl:value-of select="./value" disable-output-escaping="yes"/>
- </xsl:template>
- </xsl:stylesheet>
|