123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2017
- 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:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:out="dummy-uri" xmlns:ags="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/condition/" xmlns:agscnd="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/condition/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:doc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/doc/" exclude-result-prefixes="doc">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <doc:group prefix="agscnd">
- <doc:location>
- <doc:namespace>xmlns:agscnd="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/condition/"</doc:namespace>
- <doc:ref>ps/ags/logicsheets/condition-ui-templates.xslt</doc:ref>
- </doc:location>
- </doc:group>
- <!-- render the condition UI-->
- <doc:template type="ui">
- <doc:name>dataItemUI</doc:name>
- <doc:desc>This renders the user interface for the specify agent condition dialog</doc:desc>
- <doc:attr>
- <doc:attr-name>tab-exclusion</doc:attr-name>
- <doc:attr-desc>A space separated list of tab ids that should not be rendered. If the list is empty all tabs are rendered.</doc:attr-desc>
- </doc:attr>
- <doc:notes>This ui component is used by the new agent wizard and the define condition dialog. The tab information is defined in <i>/ps/ags/logicsheets/infoTabData.xsl</i>
- </doc:notes>
- </doc:template>
- <xsl:template match="agscnd:dataItemUI">
- <lyt:section>
- <out:call-template name="agscnd:script">
- <out:with-param name="isDataItem" select="true"/>
- </out:call-template>
- <out:call-template name="agscnd:expressionBaseUI">
- <out:with-param name="textareaId">
- <xsl:value-of select="./agscnd:param[@name='textareaId']"/>
- </out:with-param>
- </out:call-template>
- </lyt:section>
- <lyt:section>
- <out:call-template name="buildInfoSection">
- <out:with-param name="errorDivName">
- <xsl:value-of select="./agscnd:param[@name='errorDiv']"/>
- </out:with-param>
- <out:with-param name="infoDivName">
- <xsl:value-of select="./agscnd:param[@name='infoDiv']"/>
- </out:with-param>
- </out:call-template>
- </lyt:section>
- </xsl:template>
- <xsl:template match="agscnd:conditionUI">
- <lyt:section>
- <out:call-template name="agscnd:script"/>
- <out:call-template name="buildConditionTab">
- <out:with-param name="buttons">
- <xsl:text>Validate Calc Param Select</xsl:text>
- </out:with-param>
- </out:call-template>
- </lyt:section>
- <lyt:section>
- <out:call-template name="buildInfoSection">
- <out:with-param name="errorDivName">
- <xsl:value-of select="./agscnd:param[@name='errorDiv']"/>
- </out:with-param>
- <out:with-param name="infoDivName">
- <xsl:value-of select="./agscnd:param[@name='infoDiv']"/>
- </out:with-param>
- </out:call-template>
- </lyt:section>
- </xsl:template>
- <xsl:template match="agscnd:script">
- <out:template name="agscnd:script">
- <out:param name="isDataItem" select="false"/>
- <!-- create the selected tab variables -->
- <out:if test="not($isDataItem)">
- <utml:input type="hidden" name="rp_selected_tab" id="rp_selected_tab"/>
- </out:if>
- <script type="text/javascript">
- var cf = parent.getConfigFrame();
- function setTabVisible(id,isVisible)
- {
- if (null != document.getElementById('div_tab_'+id)) {
- if (isVisible) {
- if (document.documentMode < 10) {
- document.getElementById('div_tab_'+id).style.display="block";
- } else {
- document.getElementById('div_tab_'+id).style.display="table";
- }
- }
- else {
- document.getElementById('div_tab_'+id).style.display="none";
- }
- }
- }
- <out:if test="not($isDataItem)">
- function doConditionTabChange(id)
- {
- // hide all panes - not the tabs
- <out:for-each select="/root/tabset/pane">
- setTabVisible('<out:value-of select="@id"/>',false);
- </out:for-each>
- // set the selected tab pane visible
- setTabVisible(id,true);
- // set the tab that we want to display - should we move off this page
- document.pform.rp_selected_tab.value = id;
- }
- function popupSelectValueDialog(target) {
- var cf = parent.getConfigFrame();
- if (!cf.checkCAF()) {
- parent.selectValue(target,window.name);
- }
- }
- </out:if>
- </script>
- </out:template>
- </xsl:template>
- <xsl:template match="agscnd:expressionBaseUI">
- <out:template name="agscnd:expressionBaseUI">
- <out:param name="textareaId"/>
- <dp:list width="100%" padding="0">
- <out:if test="not(contains($textareaId, 'dataItem'))">
- <dp:section>
- <img height="5" width="1">
- <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
- </img>
- </dp:section>
- <dp:section width="100%">
- <dp:hint wrap="true">
- <out:choose>
- <out:when test="contains($textareaId, 'detail')">
- <out:text>
- <xts:string id="AGENT_CONDITION_DETAIL_INTRO"/>
- </out:text>
- </out:when>
- <out:otherwise>
- <out:text>
- <xts:string id="AGENT_CONDITION_SUMMARY_INTRO"/>
- </out:text>
- </out:otherwise>
- </out:choose>
- </dp:hint>
- </dp:section>
- <dp:section>
- <img height="10" width="1">
- <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
- </img>
- </dp:section>
- </out:if>
- <dp:section width="100%">
- <dp:box width="100%" noSpace="true">
- <dp:boxSection type="label" valign="bottom" align="left">
- <xts:string id="DIALOG_DATAITEM_EXPRESSION"/>
- </dp:boxSection>
- <out:if test="contains($textareaId, 'dataItem')">
- <dp:boxSection width="100%">
- <out:call-template name="buildButtons">
- <out:with-param name="buttons">
- <xsl:text>Validate Select</xsl:text>
- </out:with-param>
- <out:with-param name="selectValuesTarget">
- <out:value-of select="$textareaId"/>
- </out:with-param>
- </out:call-template>
- </dp:boxSection>
- </out:if>
- </dp:box>
- </dp:section>
- <dp:section width="100%">
- <agsdlg:insertButton selectValue="true" targetId="{'{$textareaId}'}">
- <textarea rows="16" cols="80" style="padding: 0px; width:99%;" name="{'{$textareaId}'}" id="{'{$textareaId}'}">
- <!-- Add usage information of textarea when focusing on it by keyboard, so that JAWS can read it out. -->
- <out:attribute name="title">
- <text><xts:string id="AGENT_CONDITION_TIP"/></text>
- </out:attribute>
- <out:value-of select="/root/env/param[@name=$textareaId]"/>
- </textarea>
- </agsdlg:insertButton>
- </dp:section>
- </dp:list>
- </out:template>
- </xsl:template>
- <xsl:template match="agscnd:buildInfoSection">
- <out:template name="buildInfoSection">
- <out:param name="errorDivName"/>
- <out:param name="infoDivName"/>
- <dp:list width="100%" title="AGENT_INFORMATION_LABEL" padding="0">
- <dp:section>
- <out:call-template name="buildInfoTab">
- <out:with-param name="errorDivName" select="$errorDivName"/>
- <out:with-param name="infoDivName" select="$infoDivName"/>
- </out:call-template>
- </dp:section>
- </dp:list>
- </out:template>
- </xsl:template>
- <xsl:template match="agscnd:buildButtons">
- <out:template name="buildButtons">
- <out:param name="buttons"/>
- <out:param name="selectValuesTarget"/>
- <table border="0" cellspacing="0" cellpadding="0" valign="top" align="right" role="presentation">
- <tr width="100%">
- <td nowrap="nowrap" align="right">
- <img height="16" src="../ags/images/spacer.gif" alt=""/>
- </td>
- <out:if test="contains($buttons, 'Validate')">
- <dp:columnButton>
- <img align="middle" height="16" width="16" role="button" onclick="validateSpec();">
- <out:attribute name="src">../ags/images/toolbar/16x16/action_validate.gif</out:attribute>
- <out:attribute name="alt">
- <xts:string id="DIALOG_VALIDATE_BUTTON"/>
- </out:attribute>
- <out:attribute name="id">
- <!-- put the xts string in a variable-->
- <out:variable name ="id_string">
- <xts:string id="DIALOG_VALIDATE_BUTTON"/>
- </out:variable>
- <!-- Add this part for ID unique A11Y issue -->
- <out:variable name="tab_id">
- <out:value-of select="./tabs/tab[@default = 'true']/@id"/>
- </out:variable>
- <out:value-of select="concat('id_', $tab_id, '_', $id_string)"/>
- </out:attribute>
- </img>
- </dp:columnButton>
- <td nowrap="nowrap" align="right">
- <img height="16" width="10" src="../ags/images/spacer.gif" alt=""/>
- </td>
- </out:if>
- <out:if test="contains($buttons, 'Calc')">
- <dp:columnButton>
- <img align="middle" height="16" width="16" role="button" onclick="window.parent.getConfigFrame().getCommandStackManager().initiateCommandStack("checkCAF()","showDataItem('add')");">
- <out:attribute name="src">../ags/images/toolbar/16x16/action_new_calculation.gif</out:attribute>
- <out:attribute name="alt">
- <xts:string id="DIALOG_CALCULATION_CREATE_NEW_CALCULATION"/>
- </out:attribute>
- <out:attribute name="id">
- <!-- put the xts string in a variable-->
- <out:variable name ="id_string">
- <xts:string id="DIALOG_CALCULATION_CREATE_NEW_CALCULATION"/>
- </out:variable>
- <!-- Add this part for ID unique A11Y issue -->
- <out:variable name="tab_id">
- <out:value-of select="./tabs/tab[@default = 'true']/@id"/>
- </out:variable>
- <out:value-of select="concat('id_', $tab_id, '_', $id_string)"/>
- </out:attribute>
- </img>
- </dp:columnButton>
- <td nowrap="nowrap" align="right">
- <img height="16" width="3" src="../ags/images/spacer.gif" alt=""/>
- </td>
- </out:if>
- <out:if test="contains($buttons, 'Param')">
- <dp:columnButton>
- <img align="middle" height="16" width="16" role="button" onclick="window.parent.getConfigFrame().getCommandStackManager().initiateCommandStack("checkCAF()","showParameters('add')");">
- <out:attribute name="src">../ags/images/toolbar/16x16/action_new_parameter.gif</out:attribute>
- <out:attribute name="alt">
- <xts:string id="DIALOG_PARAMETER_CREATE_NEW_PARAMETER"/>
- </out:attribute>
- <out:attribute name="id">
- <!-- put the xts string in a variable-->
- <out:variable name ="id_string">
- <xts:string id="DIALOG_PARAMETER_CREATE_NEW_PARAMETER"/>
- </out:variable>
- <!-- Add this part for ID unique A11Y issue -->
- <out:variable name="tab_id">
- <out:value-of select="./tabs/tab[@default = 'true']/@id"/>
- </out:variable>
- <out:value-of select="concat('id_', $tab_id, '_', $id_string)"/>
- </out:attribute>
- </img>
- </dp:columnButton>
- <td nowrap="nowrap" align="right">
- <img height="16" width="3" src="../ags/images/spacer.gif" alt=""/>
- </td>
- </out:if>
- <out:if test="contains($buttons, 'Select')">
- <dp:columnButton>
- <img align="middle" height="16" width="16" role="button">
- <!-- set the attributes not in the stylesheet pass but in the final XSL pass - have to be out: attributes instead -->
- <out:attribute name="onclick">popupSelectValueDialog('<out:value-of select="$selectValuesTarget"/>');</out:attribute>
- <out:attribute name="src">../ags/images/select_values.gif</out:attribute>
- <out:attribute name="alt">
- <xts:string id="TREEBAR_SELECT_VALUES"/>
- </out:attribute>
- <out:attribute name="id">
- <!-- put the xts string in a variable-->
- <out:variable name ="id_string">
- <xts:string id="TREEBAR_SELECT_VALUES"/>
- </out:variable>
- <!-- Add this part for ID unique A11Y issue -->
- <out:variable name="tab_id">
- <out:value-of select="./tabs/tab[@default = 'true']/@id"/>
- </out:variable>
- <out:value-of select="concat('id_', $tab_id, '_', $id_string)"/>
- </out:attribute>
- </img>
- </dp:columnButton>
- </out:if>
- </tr>
- </table>
- </out:template>
- </xsl:template>
- <xsl:template match="ags:buildConditionTab">
- <out:template name="buildConditionTab">
- <out:param name="buttons"/>
- <out:apply-templates select="/root/tabset/pane">
- <out:with-param name="buttons" select="$buttons"/>
- </out:apply-templates>
- </out:template>
- <out:template match="pane">
- <out:param name="buttons"/>
- <table cellpadding="0" cellspacing="0" height="100%" role="presentation">
- <out:attribute name="style">overflow:auto;width:100%;display:none</out:attribute>
- <out:attribute name="id">div_tab_<out:value-of select="@id"/>
- </out:attribute>
- <out:attribute name="role">presentation</out:attribute>
- <tr>
- <td valign="bottom" style="display:block;">
- <cp:tabset tabwidth="70">
- <cp:select>
- <out:value-of select="./tabs/tab[@default = 'true']/@id"/>
- </cp:select>
- <!-- loop through the tabs, exclude any defined in the eclusion list -->
- <out:for-each select="./tabs/tab">
- <out:choose>
- <!-- first tab found (and more tabs are available)-->
- <out:when test="position() = 1 and position() != last()">
- <cp:tab name="@id" position="start" var-name="true">
- <a href="#" onclick="{'doConditionTabChange("{@id}");'}" onmouseover="status=''; return true;">
- <cp:label>
- <out:value-of select="."/>
- </cp:label>
- </a>
- </cp:tab>
- </out:when>
- <!-- last tab found (or the only tab that has been defined) -->
- <out:when test="position() = last()">
- <cp:tab name="@id" position="end" var-name="true">
- <a href="#" onclick="{'doConditionTabChange("{@id}");'}" onmouseover="status=''; return true;">
- <cp:label>
- <out:value-of select="."/>
- </cp:label>
- </a>
- </cp:tab>
- </out:when>
- <!-- middle tabs-->
- <out:otherwise>
- <cp:tab name="@id" var-name="true">
- <a href="#" onclick="{'doConditionTabChange("{@id}");'}" onmouseover="status=''; return true;">
- <cp:label>
- <out:value-of select="."/>
- </cp:label>
- </a>
- </cp:tab>
- </out:otherwise>
- </out:choose>
- </out:for-each>
- </cp:tabset>
- </td>
- <out:if test="string-length($buttons) > 0">
- <td nowrap="nowarp">
- <table border="0" cellspacing="0" cellpadding="0" width="100%" role="presentation">
- <tr>
- <td class="tabBorder" height="20px" valign="top">
- <out:call-template name="buildButtons">
- <out:with-param name="buttons">
- <out:value-of select="$buttons"/>
- </out:with-param>
- <out:with-param name="selectValuesTarget">
- <out:value-of select="./content/@id"/>
- </out:with-param>
- </out:call-template>
- </td>
- </tr>
- </table>
- </td>
- </out:if>
- </tr>
- <tr>
- <td colspan="2" width="100%" height="100%" valign="top" style="white-space: pre-wrap;">
- <out:call-template name="agscnd:expressionBaseUI">
- <out:with-param name="textareaId">
- <out:value-of select="./content/@id"/>
- </out:with-param>
- </out:call-template>
- </td>
- </tr>
- </table>
- </out:template>
- </xsl:template>
- <!--
- This tab is consists of two panes Tips and error. It is coded to display Tips pane by default.
- -->
- <xsl:template match="ags:buildInfoTab">
- <out:template name="buildInfoTab">
- <out:param name="errorDivName"/>
- <out:param name="infoDivName"/>
- <out:call-template name="pane">
- <out:with-param name="errorDivName" select="$errorDivName"/>
- <out:with-param name="infoDivName" select="$infoDivName"/>
- <out:with-param name="tab" select="$infoDivName"/>
- </out:call-template>
- <out:call-template name="pane">
- <out:with-param name="errorDivName" select="$errorDivName"/>
- <out:with-param name="infoDivName" select="$infoDivName"/>
- <out:with-param name="tab" select="$errorDivName"/>
- <out:with-param name="display" select="'none'"/>
- </out:call-template>
- </out:template>
- <out:template name="pane">
- <out:param name="errorDivName"/>
- <out:param name="infoDivName"/>
- <out:param name="tab"/>
- <out:param name="display"/>
- <table cellpadding="0" cellspacing="0" height="100%">
- <out:attribute name="style">overflow:auto;width:100%;display:<out:value-of select="$display"/>
- </out:attribute>
- <out:attribute name="id">div_tab_<out:value-of select="$tab"/>
- </out:attribute>
- <out:attribute name="role">presentation</out:attribute>
- <tr>
- <td width="100%" height="100%" valign="top">
- <div class="infoErrorTab" width="100%">
- <out:choose>
- <out:when test="$tab = $infoDivName">
- <div class="infoErrorTabTextBold" style="margin:0px;" name="infoItemSyntax" id="infoItemSyntax"/>
- <div class="infoErrorTabText" style="margin:0px;" name="infoItemTip" id="infoItemTip"/>
- </out:when>
- <out:otherwise>
- <div class="infoErrorTabText" style="margin:0px;" name="{'{$errorDivName}'}" id="{'{$errorDivName}'}"/>
- </out:otherwise>
- </out:choose>
- </div>
- </td>
- </tr>
- <tr>
- <td valign="bottom">
- <cp:tabset inverted="true" tabwidth="70">
- <cp:select><out:value-of select="$tab"/></cp:select>
- <cp:tab position="start" var-name="true" name="$infoDivName">
- <a href="#" onclick="doInfoTabChange('{'{$infoDivName}'}')" onmouseover="status=''; return true;">
- <cp:label>
- <xts:string id="AGENT_CONDITION_TIPS_TAB"/>
- </cp:label>
- </a>
- </cp:tab>
- <cp:tab position="end" var-name="true" name="$errorDivName">
- <a href="#" onclick="doInfoTabChange('{'{$errorDivName}'}')" onmouseover="status=''; return true;">
- <cp:label>
- <xts:string id="AGENT_CONDITION_ERRORS_TAB"/>
- </cp:label>
- </a>
- </cp:tab>
- </cp:tabset>
- </td>
- </tr>
- </table>
- <script type="text/javascript">
- function doInfoTabChange(id)
- {
- setTabVisible('<out:value-of select="$infoDivName"/>',false);
- setTabVisible('<out:value-of select="$errorDivName"/>',false);
-
- if(id == 'infoItemSyntax' || id == 'infoItemTip'){
- // set the selected tab pane visible
- id = '<out:value-of select="$infoDivName"/>';
- }
-
- setTabVisible(id,true);
- }
- </script>
- </out:template>
- </xsl:template>
- <xsl:template match="agscnd:conditionFormat">
- <!-- This takes the report spec v2.0 and the filter string and extracts the text form of the condition -->
- <!-- takes a node set of these
- <dataitem preamble="sdfsdfsdf"><dimension name="thingy"/><dimension name="thingy2"/></dataitem>
- and produces the asdklalsdkj ![name]!
- -->
- <out:template name="convertCondition">
- <out:param name="data-items"/>
- <out:for-each select="$data-items/dataitem">
- <out:value-of select="./@preamble"/>
- <out:if test="count(./dimension) > 0">
- <out:text>![</out:text>
- <out:value-of select="dimension[last() - 1]/@name"/>
- <out:text>.</out:text>
- <out:value-of select="dimension[last()]/@name"/>
- <out:text>]!</out:text>
- </out:if>
- </out:for-each>
- </out:template>
- <!-- takes a node set of these
- <dataitem preamble="sdfsdfsdf"><dimension name="thingy"/><dimension name="thingy2"/></dataitem>
- and produces the asdklalsdkj ![name]!
- -->
- <out:template name="convertConditonToText">
- <out:param name="report"/>
- <out:param name="filter"/>
- <out:variable name="data-items">
- <out:call-template name="getDataItems">
- <out:with-param name="report" select="$report"/>
- <out:with-param name="filter" select="$filter"/>
- </out:call-template>
- </out:variable>
- <out:for-each select="$data-items/dataitem">
- <out:value-of select="./@preamble"/>
- <out:if test="count(./dimension) > 0">
- <out:value-of select="dimension[last()]/@name"/>
- </out:if>
- </out:for-each>
- </out:template>
- <!-- This takes a portal style condition [sdfsd].[sfsdfsdf].[final]
- and gives you back "final"
- -->
- <out:template name="conditionFormatPortal">
- <out:param name="condition"/>
- <out:variable name="dimensions">
- <out:call-template name="extractDimensions">
- <out:with-param name="dataexpressionitems">
- <out:value-of select="$condition"/>
- </out:with-param>
- </out:call-template>
- </out:variable>
- <out:for-each select="$dimensions/dimension">
- <out:if test="position() = last()">
- <out:value-of select="@name"/>
- </out:if>
- </out:for-each>
- </out:template>
- <!-- converts "blah [dataitemname] blah [Orders.Order month] blah " to the form of a node set
- <dataitem preamble="blah "><dimension name="dataexpression"/><dimension name="dataexpression"/></dataitem>
- -->
- <out:template name="getDataItems">
- <out:param name="report"/>
- <out:param name="filter"/>
- <out:choose>
- <out:when test="$filter and contains($filter, '[')">
- <out:variable name="data_item_name" select="substring-before(substring-after($filter, '['), ']')"/>
- <out:element name="dataitem">
- <out:attribute name="preamble">
- <out:value-of select="substring-before($filter, '[')"/>
- </out:attribute>
- <out:attribute name="name">
- <out:value-of select="$data_item_name"/>
- </out:attribute>
- <out:call-template name="extractDimensions">
- <out:with-param name="dataexpressionitems" select="$report/*[local-name()='queries']/*[local-name()='query']/*[local-name()='selection']/*[local-name()='dataItem'][@name=$data_item_name]/*[local-name()='expression']"/>
- </out:call-template>
- </out:element>
- <out:call-template name="getDataItems">
- <out:with-param name="filter" select="substring-after($filter, ']')"/>
- <out:with-param name="report" select="$report"/>
- </out:call-template>
- </out:when>
- <out:otherwise>
- <out:element name="dataitem">
- <out:attribute name="preamble">
- <out:value-of select="$filter"/>
- </out:attribute>
- <out:attribute name="value"/>
- </out:element>
- </out:otherwise>
- </out:choose>
- </out:template>
- <!--takes [ds1].[ds1].[query].[table].[column] and makes a node set of <dimension name="ds1"/> etc-->
- <out:template name="extractDimensions">
- <out:param name="dataexpressionitems"/>
- <out:choose>
- <out:when test="$dataexpressionitems and contains($dataexpressionitems, ']')">
- <out:variable name="dim_name" select="substring-before(substring-after($dataexpressionitems, '['), ']')"/>
- <out:element name="dimension">
- <out:attribute name="name">
- <out:value-of select="$dim_name"/>
- </out:attribute>
- </out:element>
- <out:call-template name="extractDimensions">
- <out:with-param name="dataexpressionitems" select="substring-after($dataexpressionitems, '].')"/>
- </out:call-template>
- </out:when>
- </out:choose>
- </out:template>
- </xsl:template>
- <xsl:template match="agscnd:conditionParameters">
- <!-- takes the filter from the report and extracts the parameters from it -->
- <out:template name="conditionParameters">
- <out:param name="filter"/>
- <out:if test="$filter and contains($filter , '?')">
- <out:variable name="starts_with_param" select="substring-after($filter, '?')"/>
- <out:if test="$starts_with_param and contains($starts_with_param , '?')">
- <!-- we must have a matching ? -->
- <out:element name="item">
- <out:element name="name">
- <out:value-of select="substring-before($starts_with_param, '?')"/>
- </out:element>
- </out:element>
- <!-- do the recursive call with the remainder -->
- <out:call-template name="conditionParameters">
- <out:with-param name="filter" select="substring-after($starts_with_param, '?')"/>
- </out:call-template>
- </out:if>
- </out:if>
- </out:template>
- </xsl:template>
- <!-- copy all other elements and attributes into the result-->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|