123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: rsvp
- (C) Copyright IBM Corp. 2005, 2017
- US Government Users Restricted Rights - Use, duplication or disclosure
- restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!-- COPYRIGHT_DATA { 'YEAR':[2015, 2013, 2012, 2011, 2010, 2009, 2005], 'RELEASE':['danube', 'caspian_rp1','caspian', 'colorado_rp1', 'colorado_wave1', 'colorado_wave2'], 'VISIBLE':'YES', 'COMPONENT':'rsvp' }-->
- <!--All lines above the COPYRIGHT_DATA line will be replaced when copyright notices are generated. -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:rsext="xalan://com.cognos.reportserver.ext.RSExt" extension-element-prefixes="rsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!--
- drill head
- -->
- <xsl:template name="getDrillThruHead">
- <xsl:if test="$appSupport='false'">
- <xsl:choose>
- <xsl:when test="$drillSupport='yes' and $sdkDrillSupport='false'">
- <xsl:text disable-output-escaping="yes"><script type="text/javascript" src="../cr1/drill.js"></script></xsl:text>
- <xsl:text disable-output-escaping="yes"><script type="text/javascript" src="../rv/CDrillThroughTarget.js"></script></xsl:text>
- <xsl:call-template name="addDrillThroughContext">
- <xsl:with-param name="closeScript" select="'yes'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$drillSupport='inline' or $sdkDrillSupport='true'">
- <xsl:choose>
- <xsl:when test="$strict='true'">
- <xsl:text disable-output-escaping="yes"><script type="text/javascript"></xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text disable-output-escaping="yes"><script language="javascript" type="text/javascript"></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$Xhtml='true' or $strict = 'true'">
- <xsl:text disable-output-escaping="yes">
- //<![CDATA[
- </xsl:text>
- </xsl:if>
- <xsl:text disable-output-escaping="yes">
- function CDrillThroughTarget(label, outputFormat, outputLocale, showInNewWindow, method, path, bookmarkRef, parameters, objectPaths, sPrompt, sendFilterContext, parameterProperties)
- {
- this.m_label = label;
- this.m_outputFormat = outputFormat;
- this.m_outputLocale = outputLocale;
- this.m_showInNewWindow = showInNewWindow;
- this.m_method = method;
- this.m_path = path;
- this.m_bookmarkRef = bookmarkRef;
- this.m_parameters = parameters;
- this.m_objectPaths = objectPaths;
- this.m_prompt = "false";
- this.m_sendFilterContext = sendFilterContext;
- this.m_parameterProperties = parameterProperties;
- if (typeof sPrompt != 'undefined' && sPrompt != null)
- {
- if (sPrompt == 'yes')
- {
- this.m_prompt = "true";
- }
- else if (sPrompt == 'target')
- {
- this.m_prompt = '';
- }
- }
- }
- function doSingleDrillThrough(drillThroughContext, bookmarkRef, cvId, bookmarkPage)
- {
- // handle a single drill
- var drillTargetRefIdx = drillThroughContext[0][0];
- if(typeof drillTargetRefIdx == "undefined" || drillTargetRefIdx == null)
- return;
-
- var drillTargetRef = drillTargets[drillTargetRefIdx];
- if(typeof drillTargetRef == "undefined")
- return;
-
- // check for the case of a local bookmark
- if(bookmarkRef != '' && drillTargetRef.m_path == '') {
- docLocation( bookmarkRef, bookmarkPage );
- } else {
- var args = new Array;
- args[args.length] = new Array("ui.object", drillTargetRef.m_path);
- for(var drillParmIdx = 1; drillParmIdx < drillThroughContext.length; ++drillParmIdx) {
- args[args.length] = drillThroughContext[drillParmIdx];
- }
-
- var drillForm = document.getElementById("multiDrillForm");
- if(drillForm == null)
- return;
-
- drillForm["ui.action"].value = drillTargetRef.m_method;
- drillForm["run.outputFormat"].value = drillTargetRef.m_outputFormat;
- drillForm["run.outputLocale"].value = drillTargetRef.m_outputLocale;
- drillForm["run.prompt"].value = drillTargetRef.m_prompt;
- drillForm["ui.bookmark"].value = bookmarkRef;
- if (drillTargetRef.m_method == "view") {
- drillForm["ui.object"].value = "defaultOutput(" + args[0][1] + ",\"" + drillTargetRef.m_outputFormat + "\",\"\")";
- }
- else {
- drillForm["ui.object"].value = args[0][1];
- var formFields = new Array;
- for (var i = 1; i < args.length; i++) {
- formField = document.createElement("input");
- formField.setAttribute("type", "hidden");
- formField.setAttribute("name", args[i][0]);
- formField.setAttribute("value", args[i][1]);
- formFields[formFields.length] = formField;
- drillForm.appendChild(formField);
- }
-
- drillForm["sourceContext"].value = drillTargetRef.m_parameters;
- drillForm["objectPaths"].value = drillTargetRef.m_objectPaths;
- }
- if (drillTargetRef.m_showInNewWindow == "true") {
- drillForm.setAttribute("target","_blank");
- }
-
- drillForm.submit();
- for (var i = 0; i < formFields.length; i++) {
- drillForm.removeChild(formFields[i]);
- }
- }
- }
- function doMultipleDrillThrough(drillThroughContext, cvId)
- {
- // handle multiple drills
- var drillThroughTargetStr = '<rvDrillTargets>';
-
- for(var drillTargetIdx = 0; drillTargetIdx < drillThroughContext.length; ++drillTargetIdx) {
-
- var currentDrillThroughContext = drillThroughContext[drillTargetIdx];
- if(currentDrillThroughContext.length < 3) {
- // there must be three or more parameters (drill idx, drill label and the drill parameters)
- continue;
- }
-
- var drillTargetRefIdx = currentDrillThroughContext[0];
- if(typeof drillTargetRefIdx == "undefined" || drillTargetRefIdx == null)
- continue;
-
- var drillTargetLabel = currentDrillThroughContext[1];
- if(typeof drillTargetLabel == "undefined" || drillTargetLabel == null)
- continue;
-
- var drillTargetRef = drillTargets[drillTargetRefIdx];
- if(typeof drillTargetRef == "undefined" || drillTargetRef == null)
- continue;
-
- drillThroughTargetStr += '<drillTarget ';
-
- drillThroughTargetStr += 'outputFormat="'; drillThroughTargetStr += drillTargetRef.m_outputFormat; drillThroughTargetStr += '" ';
- drillThroughTargetStr += 'outputLocale="'; drillThroughTargetStr += drillTargetRef.m_outputLocale; drillThroughTargetStr += '" ';
- drillThroughTargetStr += 'prompt="'; drillThroughTargetStr += drillTargetRef.m_prompt; drillThroughTargetStr += '" ';
- drillThroughTargetStr += 'label="'; drillThroughTargetStr += drillTargetLabel; drillThroughTargetStr += '" ';
- drillThroughTargetStr += 'path="'; drillThroughTargetStr += drillTargetRef.m_path; drillThroughTargetStr += '" ';
- drillThroughTargetStr += 'showInNewWindow="'; drillThroughTargetStr += drillTargetRef.m_showInNewWindow; drillThroughTargetStr += '" ';
- drillThroughTargetStr += 'method="'; drillThroughTargetStr += drillTargetRef.m_method; drillThroughTargetStr += '">';
-
- for(var drillParmIdx = 2; drillParmIdx < currentDrillThroughContext.length; ++drillParmIdx) {
- drillThroughTargetStr += currentDrillThroughContext[drillParmIdx];
- }
-
- drillThroughTargetStr += drillTargetRef.m_parameters;
- drillThroughTargetStr += drillTargetRef.m_objectPaths;
- drillThroughTargetStr += '</drillTarget>';
- }
- drillThroughTargetStr += '</rvDrillTargets>';
- var multiDrillForm = document.getElementById("multiDrillForm");
- if(multiDrillForm == null)
- return;
-
- multiDrillForm.drillTargets.value = drillThroughTargetStr;
- var formField = document.createElement("input");
- formField.setAttribute("type", "hidden");
- formField.setAttribute("name", "invokeGotoPage");
- formField.setAttribute("value", "true");
- multiDrillForm.appendChild(formField);
- multiDrillForm.submit();
- multiDrillForm.removeChild(formField);
- }
- </xsl:text>
- <xsl:if test="$Xhtml='true' or $strict = 'true'">
- <xsl:text disable-output-escaping="yes">
- //]]>
- </xsl:text>
- </xsl:if>
- <xsl:text disable-output-escaping="yes">
- </script>
- </xsl:text>
- <xsl:call-template name="addDrillThroughContext">
- <xsl:with-param name="closeScript" select="'yes'"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="addDrillThroughContext">
- <xsl:param name="closeScript"/>
- <xsl:text disable-output-escaping="yes"><script type="text/javascript"></xsl:text>
- <xsl:if test="$Xhtml='true'">
- <xsl:text disable-output-escaping="yes">
- //<![CDATA[
- </xsl:text>
- </xsl:if>
- var drillThroughTarget;
- var drillTargets = new Array;
- <xsl:for-each select="/Document/DRILLS/DRILL">
- <xsl:variable name="drillThroughParameters">
- <!--this template will javascript encode the xml string-->
- <xsl:apply-templates select="./*[name()='bus:parameters']" mode="drillTargets"/>
- </xsl:variable>
- <xsl:variable name="objectPaths">
- <!--this template will javascript encode the xml string-->
- <xsl:apply-templates select="./*[name()='bus:objectPaths']" mode="drillTargets"/>
- </xsl:variable>
- <xsl:variable name="parameterProperties">
- <!--this template will javascript encode the xml string-->
- <xsl:apply-templates select="./PARAMETER-PROPERTIES" mode="drillTargets"/>
- </xsl:variable>
- <xsl:variable name="outputFormat">
- <!--this template will javascript encode the xml string-->
- <xsl:choose>
- <xsl:when test="./@outputFormat">
- <xsl:choose>
- <xsl:when test="./@outputFormat='MHT'">
- <xsl:text>HTML</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./@outputFormat"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="/Document/@outputFormat='MHT'">
- <xsl:text>HTML</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/Document/@outputFormat"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- drillThroughTarget = new CDrillThroughTarget('<xsl:value-of select="rsext:javascriptencode(string(./@label))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string($outputFormat))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@outputLocale))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@showInNewWindow))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@method))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@path))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@bookmarkRef))" disable-output-escaping="yes"/>', '<xsl:value-of select="$drillThroughParameters" disable-output-escaping="yes"/>', '<xsl:value-of select="$objectPaths" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@prompt))" disable-output-escaping="yes"/>', '<xsl:value-of select="rsext:javascriptencode(string(./@sendFilterContext))" disable-output-escaping="yes"/>', '<xsl:value-of select="$parameterProperties" disable-output-escaping="yes"/>');
- drillTargets.push(drillThroughTarget);
- </xsl:for-each>
- <xsl:if test="$closeScript='yes'">
- <xsl:if test="$Xhtml='true'">
- <xsl:text disable-output-escaping="yes">
- //]]>
- </xsl:text>
- </xsl:if>
- <xsl:text disable-output-escaping="yes"></script></xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template name="getDrillThruBody">
- <xsl:if test="($drillSupport='inline' or $sdkDrillSupport='true') and ($appSupport='false')">
- <xsl:text disable-output-escaping="yes"><form name="multiDrillForm" id="multiDrillForm" method="post" action="</xsl:text><xsl:value-of select="$gatewayPath"/><xsl:text disable-output-escaping="yes">" style="margin:0px">
- <input type="hidden" name="b_action" value="xts.run"/>
- <input type="hidden" name="m" value="portal/drillthrough.xts"/>
- <input type="hidden" name="ui.action" value=""/>
- <input type="hidden" name="ui.object" value=""/>
- <input type="hidden" name="run.outputFormat" value=""/>
- <input type="hidden" name="run.outputLocale" value=""/>
- <input type="hidden" name="ui.bookmark" value=""/>
- <input type="hidden" name="run.prompt" value="false"/>
- <input type="hidden" name="nh" value="1"/>
- <input type="hidden" name="tb" value="0"/>
- <input type="hidden" name="drillTargets" value=""/>
- <input type="hidden" name="errURL" value="javascript:window.close()"/>
- <input type="hidden" name="backURL" value="javascript:window.close()"/>
- <input type="hidden" name="dfemail" value="1"/>
- <input type="hidden" name="sourceContext" value=""/>
- <input type="hidden" name="objectPaths" value=""/>
- </form>
- </xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- drillTargets on chart elements
-
- -->
- <xsl:template match="OAREA" priority="1">
- <xsl:if test="./drillTargets">
- <xsl:choose>
- <xsl:when test="$appSupport='true'">
- <xsl:attribute name="drillCtx"><xsl:value-of select="./drillTargets/@drillCtx"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style"><xsl:text>cursor:pointer;cursor:hand;</xsl:text></xsl:attribute>
- <xsl:call-template name="generateDrillThroughEventHandler">
- <xsl:with-param name="node" select="./drillTargets"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <!--
- drillTargets on Images
- -->
- <xsl:template match="OIMG/drillTargets">
- <!--
- If there is only one drill target, do the work right here and generate the correct URL based on the showInNewWindow attribute
- -->
- <xsl:if test="$appSupport='false'">
- <xsl:attribute name="style">
- <xsl:for-each select="../@style"><xsl:value-of select="."/>;</xsl:for-each>
- <xsl:text>cursor:pointer;cursor:hand;</xsl:text>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$appSupport='true'">
- <xsl:attribute name="drillCtx"><xsl:value-of select="@drillCtx"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$interactiveOutput='true' and $sdkDrillSupport='false'">
- <xsl:attribute name="dtTargets">
- <xsl:apply-templates select="*[not(self::OTI)]" mode="drillTargets"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="generateDrillThroughEventHandler">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--
- drillTargets on TextItems
- -->
- <xsl:template match="drillTargets">
- <xsl:choose>
- <xsl:when test="./WRAP">
- <div class="q-div">
- <xsl:attribute name="style"><xsl:value-of select="./WRAP/@style" /></xsl:attribute>
- <xsl:call-template name="generateDrillTargets" />
- </div>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="generateDrillTargets" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="generateDrillTargets">
- <span>
- <xsl:choose>
- <xsl:when test="$appSupport='true'">
- <xsl:attribute name="drillCtx"><xsl:value-of select="@drillCtx"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$interactiveOutput='true' and $sdkDrillSupport='false'">
- <xsl:attribute name="dtTargets">
- <xsl:apply-templates select="*[not(self::OTI) and not(self::WRAP)]" mode="drillTargets"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <!--
- If there is only one drill target, do the work right here and generate the correct URL based on the showInNewWindow attribute
- -->
- <xsl:attribute name="style"><xsl:text>cursor:pointer;cursor:hand;</xsl:text></xsl:attribute>
- <xsl:call-template name="generateDrillThroughEventHandler">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="OTI|WRAP/OTI"/>
- </span>
- </xsl:template>
-
- <xsl:template name="generateDrillThroughEventHandler">
- <xsl:param name="node"/>
- <xsl:if test="$accessible='true'">
- <xsl:attribute name="role">link</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="count($node/drillTarget) = 1 and $node/drillTarget/@bookmarkRef != '' and $drillSupport='no'">
- <!-- We only get in this template if there is drill information to be rendered
- but if drillSupport=no, then we are dealing with a simple bookmark -->
- <xsl:variable name="location">
- <xsl:text>'</xsl:text>
- <xsl:value-of select="rsext:javascriptencode(rsext:replace (rsext:urlencode(string($node/drillTarget/@bookmarkRef)), '+', '-'))"/>
- <xsl:text>'</xsl:text>
- <xsl:if test="$node/drillTarget/@bookmarkPage">
- <xsl:text>, '</xsl:text>
- <xsl:value-of select="$node/drillTarget/@bookmarkPage"/>
- <xsl:text>'</xsl:text>
- </xsl:if>
- </xsl:variable>
- <xsl:attribute name="onkeypress">if (event.keyCode==13) {docLocation(<xsl:value-of select="$location"/>);}</xsl:attribute>
- <xsl:attribute name="onclick">docLocation(<xsl:value-of select="$location"/>)</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$strict='false'">
- <xsl:attribute name="href"><xsl:text>#</xsl:text></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="onclick">
- <xsl:choose>
- <xsl:when test="count($node/drillTarget) = 1">
- <xsl:text>doSingleDrillThrough( new Array(</xsl:text>
- <xsl:text>new Array("</xsl:text><xsl:value-of select="$node/drillTarget/@drillIdx"/><xsl:text>")</xsl:text>
- <xsl:call-template name="paramsArray">
- <xsl:with-param name="drillTargetNode" select="$node/drillTarget"/>
- </xsl:call-template>
- <xsl:text>),'</xsl:text>
- <xsl:value-of select="rsext:javascriptencode(string(rsext:replace( rsext:urlencode(string($node/drillTarget/@bookmarkRef)), '+', '-')))"/>
- <xsl:text>','_THIS_'</xsl:text>
- <xsl:if test="$node/drillTarget/@bookmarkPage">
- <xsl:text>, '</xsl:text>
- <xsl:value-of select="$node/drillTarget/@bookmarkPage"/>
- <xsl:text>'</xsl:text>
- </xsl:if>
- <xsl:text>);</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>doMultipleDrillThrough( new Array(</xsl:text>
- <xsl:for-each select="$node/drillTarget">
- <xsl:text>new Array("</xsl:text><xsl:value-of select="./@drillIdx"/><xsl:text>","</xsl:text><xsl:value-of select="./@label"/><xsl:text>","</xsl:text><xsl:apply-templates select="./*" mode="drillTargets"/><xsl:text>")</xsl:text>
- <xsl:if test="position() != last()">
- <xsl:text>,</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>),'_THIS_');</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="onkeypress">
- <xsl:choose>
- <xsl:when test="count($node/drillTarget) = 1">
- <xsl:text>doSingleDrillThrough( new Array(</xsl:text>
- <xsl:text>new Array("</xsl:text><xsl:value-of select="$node/drillTarget/@drillIdx"/><xsl:text>")</xsl:text>
- <xsl:call-template name="paramsArray">
- <xsl:with-param name="drillTargetNode" select="$node/drillTarget"/>
- </xsl:call-template>
- <xsl:text>),'</xsl:text>
- <xsl:value-of select="rsext:javascriptencode(string(rsext:replace( rsext:urlencode(string($node/drillTarget/@bookmarkRef)), '+', '-')))"/>
- <xsl:text>','_THIS_'</xsl:text>
- <xsl:if test="$node/drillTarget/@bookmarkPage">
- <xsl:text>,'</xsl:text>
- <xsl:value-of select="$node/drillTarget/@bookmarkPage"/>
- <xsl:text>'</xsl:text>
- </xsl:if>
- <xsl:text>);</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>doMultipleDrillThrough( new Array(</xsl:text>
- <xsl:for-each select="$node/drillTarget">
- <xsl:text>new Array("</xsl:text><xsl:value-of select="./@drillIdx"/><xsl:text>","</xsl:text><xsl:value-of select="./@label"/><xsl:text>","</xsl:text><xsl:apply-templates select="./*" mode="drillTargets"/><xsl:text>")</xsl:text>
- <xsl:if test="position() != last()">
- <xsl:text>,</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>),'_THIS_');</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Build up the parameters array
- -->
- <xsl:template name="paramsArray">
- <xsl:param name="drillTargetNode"/>
- <xsl:variable name="drillTargetLabel" select="$drillTargetNode/@label"/>
-
- <xsl:for-each select="$drillTargetNode/drillParameter">
- <xsl:choose>
- <xsl:when test="./@value!=''">
- <xsl:variable name="selectChoices">
- <xsl:choose>
- <!--when selectChoices element is passed through, it's has already been xml encoded, so don't double encode it -->
- <xsl:when test="starts-with(normalize-space(string(./@value)), '<selectChoices>')">
- <xsl:value-of select="string(./@value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text><selectChoices></xsl:text>
- <xsl:text><selectOption </xsl:text>
- <xsl:text>useValue="</xsl:text>
- <xsl:value-of select="rsext:xmlencode(string(./@value))"/>
- <xsl:text>" </xsl:text>
- <xsl:if test="./@mun!=''">
- <xsl:text>mun="</xsl:text>
- <xsl:value-of select="rsext:xmlencode(string(./@mun))"/>
- <xsl:text>" </xsl:text>
- </xsl:if>
- <xsl:variable name="parameterName" select="@name"/>
- <xsl:if test="/Document/DRILLS/DRILL[@label = string($drillTargetLabel)]/PARAMETER-PROPERTIES/Parameter[@name=string($parameterName)]/@propertyToPass != ''">
- <xsl:text>propertyToPass="</xsl:text>
- <xsl:value-of select="rsext:xmlencode(string(/Document/DRILLS/DRILL[@label = string($drillTargetLabel)]/PARAMETER-PROPERTIES/Parameter[@name=string($parameterName)]/@propertyToPass))"/>
- <xsl:text>" </xsl:text>
- </xsl:if>
- <xsl:text>displayValue="</xsl:text>
- <xsl:choose>
- <xsl:when test="./@displayValue"><xsl:value-of select="rsext:xmlencode(string(./@displayValue))"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="rsext:xmlencode(string(./@value))"/></xsl:otherwise>
- </xsl:choose>
- <xsl:text>"/></xsl:text>
- <xsl:text></selectChoices></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>, new Array("p_</xsl:text><xsl:value-of select="rsext:javascriptencode(string(./@name))" disable-output-escaping="yes"/><xsl:text>","</xsl:text><xsl:value-of select="rsext:javascriptencode(string($selectChoices))" disable-output-escaping="yes"/><xsl:text>")</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="selectChoices">
- <xsl:text><selectChoices></xsl:text>
- <xsl:text></selectChoices></xsl:text>
- </xsl:variable>
- <xsl:text>, new Array("p_</xsl:text><xsl:value-of select="rsext:javascriptencode(string(./@name))" disable-output-escaping="yes"/><xsl:text>","</xsl:text><xsl:value-of select="rsext:javascriptencode(string($selectChoices))" disable-output-escaping="yes"/><xsl:text>")</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="*" mode="drillTargets">
- <xsl:text><</xsl:text>
- <xsl:value-of select="name()"/>
- <xsl:apply-templates select="@*" mode="drillTargets"/>
- <xsl:if test="local-name()='drillParameter'">
- <xsl:variable name="parameterName" select="@name"/>
- <xsl:variable name="drillTargetLabel" select="../@label"/>
- <xsl:if test="/Document/DRILLS/DRILL[@label = string($drillTargetLabel)]/PARAMETER-PROPERTIES/Parameter[@name=string($parameterName)]/@propertyToPass != ''">
- <xsl:text> propertyToPass=\"</xsl:text>
- <xsl:value-of select="rsext:xmlencode(string(/Document/DRILLS/DRILL[@label = string($drillTargetLabel)]/PARAMETER-PROPERTIES/Parameter[@name=string($parameterName)]/@propertyToPass))"/>
- <xsl:text>\"</xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:text>/></xsl:text>
- </xsl:template>
- <!-- generate text for an element with children or text -->
- <xsl:template match="*[* | text()]" mode="drillTargets">
- <xsl:text><</xsl:text>
- <xsl:value-of select="name()"/>
- <xsl:apply-templates select="@*" mode="drillTargets"/>
- <xsl:text>></xsl:text>
- <xsl:apply-templates select="* | text()" mode="drillTargets"/>
- <xsl:text><\/</xsl:text>
- <xsl:value-of select="name()"/>
- <xsl:text>></xsl:text>
- </xsl:template>
- <!-- generate text for an attribute -->
- <xsl:template match="@*" mode="drillTargets">
- <xsl:text> </xsl:text>
- <xsl:value-of select="name()"/>
- <xsl:text>=\"</xsl:text>
- <xsl:value-of select="rsext:javascriptencode(rsext:xmlencode(string(.)))"/>
- <xsl:text>\"</xsl:text>
- </xsl:template>
- <!-- generate text -->
- <xsl:template match="text()" mode="drillTargets">
- <xsl:value-of select="rsext:xmlencode(string(.))"/>
- </xsl:template>
- <!-- We do not want any of the OTI stuff -->
- <xsl:template match="OTI" mode="drillTargets">
- <!-- do nothing -->
- </xsl:template>
- </xsl:stylesheet>
|