123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2011
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
- SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template name="SetParameters">
- <bus:parameterValues xsi:type="bus:parameterValueArray" SOAP-ENC:arrayType="bus:parameterValue[]">
- <xsl:for-each select="/root/PromptValues/PromptValue">
- <item>
- <bus:name xsi:type="xs:string"><xsl:value-of select="@name"/></bus:name>
- <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parmValueItem[]">
- <xsl:if test="not(./selectChoices)">
- <!-- could be a ambiguous prompt or a prompt which isn't mandatory -->
- <xsl:for-each select=".">
- <xsl:choose>
- <!-- deal with ambiguous connections and signons -->
- <xsl:when test="string(.) != ''">
- <item xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:display xsi:type="xs:string"><xsl:value-of select="."/></bus:display>
- <bus:use xsi:type="xs:string"><xsl:value-of select="."/></bus:use>
- </item>
- </xsl:when>
- <xsl:otherwise>
- <item xsi:type="bus:simpleParmValueItem" xsi:nil="true"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="./selectChoices/selectOption">
- <item xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <xsl:choose>
- <xsl:when test="@displayValue!=''">
- <bus:display xsi:type="xs:string"><xsl:value-of select="@displayValue"/></bus:display>
- </xsl:when>
- <xsl:otherwise>
- <bus:display xsi:nil="true"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@useValue!=''">
- <bus:use xsi:type="xs:string"><xsl:value-of select="@useValue"/></bus:use>
- </xsl:when>
- <xsl:otherwise>
- <bus:use xsi:nil="true"/>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- </xsl:for-each>
- <xsl:for-each select="./selectChoices/selectBoundRange">
- <item xsi:type="bus:boundRangeParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:start xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:display xsi:type="xs:string"><xsl:value-of select="./start/@displayValue"/></bus:display>
- <bus:use xsi:type="xs:string"><xsl:value-of select="./start/@useValue"/></bus:use>
- </bus:start>
- <bus:end xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:display xsi:type="xs:string"><xsl:value-of select="./end/@displayValue"/></bus:display>
- <bus:use xsi:type="xs:string"><xsl:value-of select="./end/@useValue"/></bus:use>
- </bus:end>
- </item>
- </xsl:for-each>
- <xsl:for-each select="./selectChoices/selectUnboundedEndRange">
- <item xsi:type="bus:unboundedEndRangeParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:start xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:display xsi:type="xs:string"><xsl:value-of select="./start/@displayValue"/></bus:display>
- <bus:use xsi:type="xs:string"><xsl:value-of select="./start/@useValue"/></bus:use>
- </bus:start>
- </item>
- </xsl:for-each>
- <xsl:for-each select="./selectChoices/selectUnboundedStartRange">
- <item xsi:type="bus:unboundedStartRangeParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:end xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:display xsi:type="xs:string"><xsl:value-of select="./end/@displayValue"/></bus:display>
- <bus:use xsi:type="xs:string"><xsl:value-of select="./end/@useValue"/></bus:use>
- </bus:end>
- </item>
- </xsl:for-each>
- <xsl:for-each select="./selectChoices/selectTreeOption">
- <xsl:call-template name="selectTreeOption"/>
- </xsl:for-each>
- </bus:value>
- </item>
- </xsl:for-each>
- </bus:parameterValues>
- </xsl:template>
-
- <xsl:template name="selectTreeOption">
- <item xsi:type="bus:hierarchicalParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <value xsi:type="bus:simpleParmValueItem">
- <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
- <bus:display xsi:type="xs:string"><xsl:value-of select="./@displayValue"/></bus:display>
- <bus:use xsi:type="xs:string"><xsl:value-of select="./@useValue"/></bus:use>
- </value>
- <xsl:choose>
- <xsl:when test="./selectTreeOption">
- <subNodes xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:hierarchicalParmValueItem[]" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:for-each select="./selectTreeOption">
- <xsl:call-template name="selectTreeOption"/>
- </xsl:for-each>
- </subNodes>
- </xsl:when>
- <xsl:otherwise>
- <subNodes xsi:nil="true"/>
- </xsl:otherwise>
- </xsl:choose>
- </item>
- </xsl:template>
- </xsl:stylesheet>
|