123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: CCS
- (c) Copyright IBM Corp. 2005, 2019
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet xmlns:rds="http://developer.cognos.com/schemas/rds/types/2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
- <!---->
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/">
- <rds:prompts>
- <canFinish>
- <xsl:choose>
- <xsl:when test="Document/DATA/PAGE/@canFinish">
- <xsl:value-of select="Document/DATA/PAGE/@canFinish"/>
- </xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </canFinish>
- <hasNextPage>
- <xsl:choose>
- <xsl:when test="Document/DATA/PAGE/@canNext">
- <xsl:value-of select="Document/DATA/PAGE/@canNext"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </hasNextPage>
- <xsl:apply-templates select="//FORM[parent::node()[name()!='FORM']] | //selectValue[parent::node()[name()!='FORM']] | //textBox[parent::node()[name()!='FORM']] | //selectDateTime[parent::node()[name()!='FORM']] | //selectDate[parent::node()[name()!='FORM']]| //selectTime[parent::node()[name()!='FORM']]| //selectWithSearch[parent::node()[name()!='FORM']] | //selectWithTree[parent::node()[name()!='FORM']] | //selectInterval[parent::node()[name()!='FORM']]"/>
- </rds:prompts>
- </xsl:template>
- <xsl:template match="FORM">
- <xsl:choose>
- <xsl:when test="@columnName">
- <xsl:apply-templates select="selectValue | textBox | selectDateTime | selectDate | selectTime | selectWithSearch | selectWithTree | selectInterval | selectDataSourceSignon">
- <xsl:with-param name="colName">
- <xsl:value-of select="@columnName"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="selectValue | textBox | selectDateTime | selectDate | selectTime | selectWithSearch | selectWithTree | selectInterval | selectDataSourceSignon | FORM"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="selectDataSourceSignon ">
- <xsl:param name="colName"/>
- <rds:item>
- <rds:PDataSource>
- <rds:name>
- <xsl:value-of select="concat('credential:', ./connection/@name)"/>
- </rds:name>
- <rds:connection>
- <rds:name>
- <xsl:value-of select="./connection/@name"/>
- </rds:name>
- <rds:searchPath>
- <xsl:value-of select="./connection/@searchPath"/>
- </rds:searchPath>
- <rds:selected>
- <xsl:value-of select="./connection/@selected"/>
- </rds:selected>
- </rds:connection>
- <xsl:for-each select="./connection/signon">
- <rds:signon>
- <xsl:if test="@name">
- <rds:name>
- <xsl:value-of select="@name"/>
- </rds:name>
- </xsl:if>
- <xsl:if test="@searchPath">
- <rds:searchPath>
- <xsl:value-of select="@searchPath"/>
- </rds:searchPath>
- </xsl:if>
- <xsl:if test="@selected">
- <rds:selected>
- <xsl:value-of select="@selected"/>
- </rds:selected>
- </xsl:if>
- </rds:signon>
- </xsl:for-each>
- </rds:PDataSource>
- </rds:item>
- </xsl:template>
- <xsl:template match="selectValue">
- <xsl:param name="colName"/>
- <rds:item>
- <rds:PListBox>
- <rds:name>
- <xsl:value-of select="@parameter"/>
- </rds:name>
- <rds:multiSelect>
- <xsl:value-of select="@multiSelect"/>
- </rds:multiSelect>
- <rds:range>
- <xsl:value-of select="@range"/>
- </rds:range>
- <rds:required>
- <xsl:value-of select="@required"/>
- </rds:required>
- <rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@autoSubmit">
- <xsl:value-of select="@autoSubmit"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@columnName">
- <rds:columnName>
- <xsl:value-of select="@columnName"/>
- </rds:columnName>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$colName">
- <rds:columnName>
- <xsl:value-of select="$colName"/>
- </rds:columnName>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <rds:selections>
- <xsl:choose>
- <xsl:when test="selectChoices/selectOption">
- <xsl:for-each select="selectChoices/selectOption">
- <rds:options>
- <xsl:choose>
- <xsl:when test="@nullUse">
- <rds:useValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@nullDisplay">
- <rds:displayValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </xsl:otherwise>
- </xsl:choose>
- </rds:options>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="selectChoices/selectBoundRange | selectChoices/selectUnboundedEndRange| selectChoices/selectUnboundedStartRange ">
- <rds:rangeOptions>
- <xsl:if test="start">
- <rds:start>
- <rds:useValue>
- <xsl:value-of select="start/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="start/@displayValue"/>
- </rds:displayValue>
- </rds:start>
- </xsl:if>
- <xsl:if test="end">
- <rds:end>
- <rds:useValue>
- <xsl:value-of select="end/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="end/@displayValue"/>
- </rds:displayValue>
- </rds:end>
- </xsl:if>
- </rds:rangeOptions>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </rds:selections>
- <xsl:for-each select="selectOptions/selectOption">
- <rds:options>
- <xsl:choose>
- <xsl:when test="@nullUse">
- <rds:useValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@nullDisplay">
- <rds:displayValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </xsl:otherwise>
- </xsl:choose>
- </rds:options>
- </xsl:for-each>
- </rds:PListBox>
- </rds:item>
- </xsl:template>
- <xsl:template match="selectWithSearch">
- <xsl:param name="colName"/>
- <rds:item>
- <rds:PSearchAndSelect>
- <rds:name>
- <xsl:value-of select="@parameter"/>
- </rds:name>
- <rds:multiSelect>
- <xsl:value-of select="@multiSelect"/>
- </rds:multiSelect>
- <rds:required>
- <xsl:value-of select="@required"/>
- </rds:required>
- <rds:id>
- <xsl:value-of select="@name"/>
- </rds:id>
- <rds:parameter>
- <xsl:value-of select="@parameter"/>
- </rds:parameter>
- <rds:matchAll>
- <xsl:value-of select="@matchAll"/>
- </rds:matchAll>
- <rds:matchAnywhere>
- <xsl:value-of select="@matchAnywhere"/>
- </rds:matchAnywhere>
- <rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@autoSubmit">
- <xsl:value-of select="@autoSubmit"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@columnName">
- <rds:columnName>
- <xsl:value-of select="@columnName"/>
- </rds:columnName>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$colName">
- <rds:columnName>
- <xsl:value-of select="$colName"/>
- </rds:columnName>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <rds:selections>
- <xsl:choose>
- <xsl:when test="selectChoices/selectOption">
- <xsl:for-each select="selectChoices/selectOption">
- <rds:options>
- <xsl:choose>
- <xsl:when test="@nullUse">
- <rds:useValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@nullDisplay">
- <rds:displayValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </xsl:otherwise>
- </xsl:choose>
- </rds:options>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="selectChoices/selectBoundRange | selectChoices/selectUnboundedEndRange| selectChoices/selectUnboundedStartRange ">
- <rds:rangeOptions>
- <xsl:if test="start">
- <rds:start>
- <xsl:choose>
- <xsl:when test="start/@nullUse">
- <rds:useValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:useValue>
- <xsl:value-of select="start/@useValue"/>
- </rds:useValue>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="start/@nullDisplay">
- <rds:displayValue nil="true"/>
- </xsl:when>
- <xsl:otherwise>
- <rds:displayValue>
- <xsl:value-of select="start/@displayValue"/>
- </rds:displayValue>
- </xsl:otherwise>
- </xsl:choose>
- </rds:start>
- </xsl:if>
- <xsl:if test="end">
- <rds:end>
- <rds:useValue>
- <xsl:value-of select="end/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="end/@displayValue"/>
- </rds:displayValue>
- </rds:end>
- </xsl:if>
- </rds:rangeOptions>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </rds:selections>
- <xsl:for-each select="selectOptions/selectOption">
- <rds:options>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </rds:options>
- </xsl:for-each>
- </rds:PSearchAndSelect>
- </rds:item>
- </xsl:template>
- <xsl:template match="textBox">
- <xsl:param name="colName"/>
- <rds:item>
- <rds:PTextBox>
- <rds:name>
- <xsl:value-of select="@parameter"/>
- </rds:name>
- <rds:multiSelect>
- <xsl:value-of select="@multiSelect"/>
- </rds:multiSelect>
- <rds:range>
- <xsl:value-of select="@range"/>
- </rds:range>
- <rds:required>
- <xsl:value-of select="@required"/>
- </rds:required>
- <rds:numericOnly>
- <xsl:value-of select="@numbersOnly"/>
- </rds:numericOnly>
- <rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@autoSubmit">
- <xsl:value-of select="@autoSubmit"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@columnName">
- <rds:columnName>
- <xsl:value-of select="@columnName"/>
- </rds:columnName>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$colName">
- <rds:columnName>
- <xsl:value-of select="$colName"/>
- </rds:columnName>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <rds:selections>
- <xsl:choose>
- <xsl:when test="selectChoices/selectOption">
- <xsl:for-each select="selectChoices/selectOption">
- <rds:options>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </rds:options>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="selectChoices/selectBoundRange | selectChoices/selectUnboundedEndRange| selectChoices/selectUnboundedStartRange ">
- <rds:rangeOptions>
- <xsl:if test="start">
- <rds:start>
- <rds:useValue>
- <xsl:value-of select="start/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="start/@displayValue"/>
- </rds:displayValue>
- </rds:start>
- </xsl:if>
- <xsl:if test="end">
- <rds:end>
- <rds:useValue>
- <xsl:value-of select="end/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="end/@displayValue"/>
- </rds:displayValue>
- </rds:end>
- </xsl:if>
- </rds:rangeOptions>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </rds:selections>
- </rds:PTextBox>
- </rds:item>
- </xsl:template>
- <xsl:template match="selectWithTree">
- <xsl:param name="colName"/>
- <rds:item>
- <rds:PTreePrompt>
- <rds:name>
- <xsl:value-of select="@parameter"/>
- </rds:name>
- <rds:multiSelect>
- <xsl:value-of select="@multiSelect"/>
- </rds:multiSelect>
- <rds:required>
- <xsl:value-of select="@required"/>
- </rds:required>
- <rds:treeUI>
- <xsl:value-of select="@selectTreeUI"/>
- </rds:treeUI>
- <rds:canExpand>
- <xsl:value-of select="@canExpand"/>
- </rds:canExpand>
- <rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@autoSubmit">
- <xsl:value-of select="@autoSubmit"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@columnName">
- <rds:columnName>
- <xsl:value-of select="@columnName"/>
- </rds:columnName>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$colName">
- <rds:columnName>
- <xsl:value-of select="$colName"/>
- </rds:columnName>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <rds:selections>
- <xsl:for-each select="selectChoices/selectOption">
- <rds:options>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </rds:options>
- </xsl:for-each>
- </rds:selections>
- <rds:selectionsAncestry>
- <xsl:for-each select="selectChoicesAncestry/selectOption">
- <rds:options>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </rds:options>
- </xsl:for-each>
- </rds:selectionsAncestry>
- <rds:treePromptNode>
- <xsl:for-each select="./selectOptions/selectTreeOption">
- <rds:options>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </rds:options>
- </xsl:for-each>
- </rds:treePromptNode>
- </rds:PTreePrompt>
- </rds:item>
- </xsl:template>
- <xsl:template match="selectDate">
- <xsl:param name="colName"/>
- <xsl:call-template name="dateTime">
- <xsl:with-param name="dtType" select="'DATE'"/>
- <xsl:with-param name="colName" select="$colName"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="selectTime">
- <xsl:param name="colName"/>
- <xsl:call-template name="dateTime">
- <xsl:with-param name="dtType" select="'TIME'"/>
- <xsl:with-param name="colName" select="$colName"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="selectDateTime">
- <xsl:param name="colName"/>
- <xsl:call-template name="dateTime">
- <xsl:with-param name="dtType" select="'DATETIME'"/>
- <xsl:with-param name="colName" select="$colName"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="selectInterval">
- <xsl:param name="colName"/>
- <xsl:call-template name="dateTime">
- <xsl:with-param name="dtType" select="'INTERVAL'"/>
- <xsl:with-param name="colName" select="$colName"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="dateTime">
- <xsl:param name="colName"/>
- <xsl:param name="dtType"/>
- <rds:item>
- <rds:PDateTimeBox>
- <rds:name>
- <xsl:value-of select="@parameter"/>
- </rds:name>
- <rds:multiSelect>
- <xsl:value-of select="@multiSelect"/>
- </rds:multiSelect>
- <rds:range>
- <xsl:value-of select="@range"/>
- </rds:range>
- <rds:required>
- <xsl:value-of select="@required"/>
- </rds:required>
- <rds:valueType>
- <xsl:value-of select="$dtType"/>
- </rds:valueType>
- <xsl:choose>
- <xsl:when test="@calendar='Gregorian'">
- <rds:calendarType>GREGORIAN</rds:calendarType>
- </xsl:when>
- <xsl:when test="@calendar='Imperial'">
- <rds:calendarType>IMPERIAL</rds:calendarType>
- </xsl:when>
- <xsl:otherwise>
- <rds:calendarType>GREGORIAN</rds:calendarType>
- </xsl:otherwise>
- </xsl:choose>
- <rds:displaySeconds>
- <xsl:choose>
- <xsl:when test="@showSeconds">
- <xsl:value-of select="@showSeconds"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:displaySeconds>
- <rds:displayMilliSeconds>
- <xsl:choose>
- <xsl:when test="@showMilliseconds">
- <xsl:value-of select="@showMilliseconds"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:displayMilliSeconds>
- <rds:firstDate>
- <xsl:choose>
- <xsl:when test="@firstDate">
- <xsl:value-of select="@firstDate"/>
- </xsl:when>
- <xsl:otherwise>0001-01-01</xsl:otherwise>
- </xsl:choose>
- </rds:firstDate>
- <rds:lastDate>
- <xsl:choose>
- <xsl:when test="@lastDate">
- <xsl:value-of select="@lastDate"/>
- </xsl:when>
- <xsl:otherwise>9999-12-31</xsl:otherwise>
- </xsl:choose>
- </rds:lastDate>
- <rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@autoSubmit">
- <xsl:value-of select="@autoSubmit"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </rds:autoSubmit>
- <xsl:choose>
- <xsl:when test="@columnName">
- <rds:columnName>
- <xsl:value-of select="@columnName"/>
- </rds:columnName>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$colName">
- <rds:columnName>
- <xsl:value-of select="$colName"/>
- </rds:columnName>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <rds:selections>
- <xsl:choose>
- <xsl:when test="selectChoices/selectOption">
- <xsl:for-each select="selectChoices/selectOption">
- <rds:options>
- <rds:useValue>
- <xsl:value-of select="@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="@displayValue"/>
- </rds:displayValue>
- </rds:options>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="selectChoices/selectBoundRange | selectChoices/selectUnboundedEndRange| selectChoices/selectUnboundedStartRange ">
- <rds:rangeOptions>
- <xsl:if test="start">
- <rds:start>
- <rds:useValue>
- <xsl:value-of select="start/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="start/@displayValue"/>
- </rds:displayValue>
- </rds:start>
- </xsl:if>
- <xsl:if test="end">
- <rds:end>
- <rds:useValue>
- <xsl:value-of select="end/@useValue"/>
- </rds:useValue>
- <rds:displayValue>
- <xsl:value-of select="end/@displayValue"/>
- </rds:displayValue>
- </rds:end>
- </xsl:if>
- </rds:rangeOptions>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </rds:selections>
- </rds:PDateTimeBox>
- </rds:item>
- </xsl:template>
- </xsl:stylesheet>
|