123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- 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:hts="http://developer.cognos.com/myinbox/common/hts_ui"
- exclude-result-prefixes="xts hts">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="hts:action">
- <xsl:apply-templates select="./*"/>
- </xsl:template>
- <xsl:template match="hts:actionlist">
- <table role="presentation">
- <tr>
- <xsl:for-each select="./hts:action">
- <td>
- <xsl:if test="./@id">
- <xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./@style">
- <xsl:attribute name="style"><xsl:value-of select="./@style"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="."/>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </xsl:template>
- <xsl:template match="hts:button">
- <xsl:variable name="btncls">
- <xsl:choose>
- <xsl:when test="not(@nospace)"><xsl:text>cogstyle-layout-button-spacing</xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>cogstyle-layout-button</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="useClass">
- <xsl:choose>
- <xsl:when test="not(@class)">htsButton</xsl:when>
- <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="useType">
- <xsl:choose>
- <xsl:when test="string(@type)='reset' or string(@type)='submit'"><xsl:value-of select="@type"/></xsl:when>
- <xsl:otherwise>button</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <div class="{$btncls}">
- <input role="button" class="{$useClass}" type="{$useType}" onmouseout="javascript:this.className='htsButton'" onmouseover="javascript:this.className='htsButtonMouseOver'">
- <xsl:copy-of select="@*[name()!='type' and name()!='class']"/>
- <xsl:attribute name="value"><xsl:apply-templates select="./hts:value"/></xsl:attribute>
- </input>
- </div>
- </xsl:template>
- <xsl:template match="hts:column">
- <xsl:variable name="pcnt" select="floor(100 div (count(following-sibling::hts:column) + count(preceding-sibling::hts:column) + 1))"/>
- <td width="{$pcnt}%">
- <xsl:apply-templates select="./*"/>
- </td>
- </xsl:template>
-
- <xsl:template match="hts:columnset">
- <div class="cogstyle-layout-column-set">
- <table width="100%" role="presentation">
- <tr class="cogstyle-layout-column">
- <xsl:apply-templates select="./*"/>
- </tr>
- </table>
- </div>
- </xsl:template>
-
- <xsl:template match="hts:field">
- <xsl:variable name="useFieldSR">
- <xsl:apply-templates select="./hts:keyscript"/>
- </xsl:variable>
- <xsl:variable name="fId">
- <xsl:choose>
- <xsl:when test="contains(string(@id),'_THIS_')">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('_THIS_',@id)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="fValue">
- <xsl:choose>
- <xsl:when test="./*[name()='hts:text']">
- <xsl:apply-templates select="./*[name()='hts:text']"/>
- </xsl:when>
- <xsl:when test="./*[name()='hts:value']">
- <xsl:apply-templates select="./*[name()='hts:value']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="useClass">
- <xsl:choose>
- <xsl:when test="@class"><xsl:value-of select="@class"/></xsl:when>
- <xsl:otherwise>portlet-form-input-field</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <div class="cogstyle-layout-field"><xsl:text/>
- <xsl:if test="not(./hts:label)"><xsl:apply-templates select="./hts:hint"/></xsl:if>
- <xsl:apply-templates select="./hts:label">
- <xsl:with-param name="forParam" select="string($fId)"/>
- </xsl:apply-templates>
- <xsl:choose>
- <xsl:when test="@type='textarea'">
- <xsl:variable name="fRows">
- <xsl:choose>
- <xsl:when test="@rows"><xsl:value-of select="@rows"/></xsl:when>
- <xsl:otherwise>10</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="fCols">
- <xsl:choose>
- <xsl:when test="@cols"><xsl:value-of select="@cols"/></xsl:when>
- <xsl:otherwise>80</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <table cellpadding="0" cellspacing="0" class="cogstyle-layout-wide" role="presentation">
- <tr>
- <td>
- <textarea role="textbox" aria-multiline="true" class="{$useClass}">
- <xsl:copy-of select="@*[name()!='id' and name()!='name' and name()!='rows' and name()!='cols' and name()!='class']"/>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="$fId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@name">
- <xsl:attribute name="name"><xsl:value-of select="concat('_THIS_',@name)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="rows"><xsl:value-of select="$fRows"/></xsl:attribute>
- <xsl:attribute name="cols"><xsl:value-of select="$fCols"/></xsl:attribute>
- <xsl:if test="$useFieldSR != ''">
- <xsl:attribute name="onkeypress"><xsl:value-of select="$useFieldSR"/></xsl:attribute>
- </xsl:if>
- <xsl:text/><xsl:value-of select="$fValue"/><xsl:text/>
- </textarea>
- </td>
- </tr>
- <xsl:if test="./hts:action">
- <tr>
- <td class="cogstyle-layout-action-list"><xsl:apply-templates select="./hts:action"/></td>
- </tr>
- </xsl:if>
- <xsl:if test="./hts:actionlist">
- <tr>
- <td class="cogstyle-layout-action-list"><xsl:apply-templates select="./hts:actionlist"/></td>
- </tr>
- </xsl:if>
- </table>
- </xsl:when>
- <xsl:otherwise>
- <table cellpadding="0" cellspacing="0" role="presentation">
- <tr>
- <td>
- <input class="{$useClass}">
- <xsl:copy-of select="@*[name()!='id' and name()!='name' and name()!='class']"/>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="$fId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@name">
- <xsl:attribute name="name"><xsl:value-of select="concat('_THIS_',@name)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="value">
- <xsl:value-of select="$fValue"/>
- </xsl:attribute>
- <xsl:if test="$useFieldSR != ''">
- <xsl:attribute name="onkeypress"><xsl:value-of select="$useFieldSR"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@type='text'">
- <xsl:attribute name="role"><xsl:text>textbox</xsl:text></xsl:attribute>
- <xsl:attribute name="aria-multiline"><xsl:text>false</xsl:text></xsl:attribute>
- </xsl:if>
- </input>
- </td>
- </tr>
- </table>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </xsl:template>
- <xsl:template match="hts:form">
- <form role="form">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="hts:section[@format='header']"/>
- <div class="cogstyle-layout-on-form">
- <xsl:apply-templates select="*[not((name()='hts:section' and string(@format)='header')or (name()='hts:section' and string(@format)='footer'))]"/>
- </div>
- <xsl:apply-templates select="hts:section[@format='footer']"/>
- </form>
- </xsl:template>
- <xsl:template match="hts:hidden">
- <xsl:call-template name="createHiddenField">
- <xsl:with-param name="chfName" select="@name"/>
- <xsl:with-param name="chfValue" select="@value"/>
- <xsl:with-param name="chfId" select="@id"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="hts:hint">
- <xsl:if test="string(.)!=''">
- <xsl:if test="not(parent::hts:label)"><xsl:text disable-output-escaping="yes"><table></xsl:text></xsl:if>
- <tr>
- <td class="cogstyle-layout-hint">
- <div class="portlet-msg-info" role="note">
- <xsl:choose>
- <xsl:when test="./hts:text">
- <xsl:apply-templates select="./*"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </td>
- </tr>
- <xsl:if test="not(parent::hts:label)"><xsl:text disable-output-escaping="yes"></table></xsl:text></xsl:if>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="hts:img">
- <img>
- <xsl:if test="not(@role)">
- <xsl:attribute name="role">
- <xsl:text>img</xsl:text>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="./*"/>
- </img>
- </xsl:template>
-
- <xsl:template match="hts:faded">
- <xsl:attribute name="class">cogstyle-img-faded</xsl:attribute>
- </xsl:template>
- <xsl:template match="hts:keyscript">
- <xsl:value-of select="."/>
- </xsl:template>
-
- <xsl:template match="hts:label">
- <xsl:param name="forParam" select="''"/>
- <xsl:if test="string(.)!=''">
- <xsl:variable name="labelclass">
- <xsl:choose>
- <xsl:when test="not(ancestor::hts:rcsection) and string(@divider)='true'">cogstyle-layout-divider-label</xsl:when>
- <xsl:when test="not(ancestor::hts:rcsection)">cogstyle-layout-label</xsl:when>
- <xsl:otherwise>cogstyle-layout-label-in-control</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="forID">
- <xsl:choose>
- <xsl:when test="@for"><xsl:value-of select="@for"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$forParam"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <table class="cogstyle-layout-wide" cellpadding="0" cellspacing="0">
- <xsl:choose>
- <xsl:when test="string(@divider)='true'">
- <tr>
- <td class="{$labelclass}">
- <div class="portlet-form-field-label">
- <xsl:if test="$forID != ''"><xsl:text disable-output-escaping="yes"><label for="</xsl:text><xsl:value-of select="$forID"/><xsl:text disable-output-escaping="yes">"></xsl:text></xsl:if>
- <xsl:apply-templates select="hts:text"/>
- <xsl:if test="$forID != ''"><xsl:text disable-output-escaping="yes"></label></xsl:text></xsl:if>
- </div>
- </td>
- <td class="cogstyle-layout-divider"><div class="cogstyle-layout-divider-line"></div></td>
- </tr>
- <xsl:if test="./hts:hint">
- <tr>
- <td colspan="2"><table cellspacing="0"><xsl:apply-templates select="./hts:hint"/></table></td>
- </tr>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="labelClass">
- <xsl:choose>
- <xsl:when test="count(preceding-sibling::hts:label)=0"><xsl:value-of select="$labelclass"/></xsl:when>
- <xsl:otherwise>cogstyle-layout-sub-label</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr>
- <td>
- <xsl:attribute name="class"><xsl:value-of select="$labelClass"/></xsl:attribute>
- <div class="portlet-form-field-label">
- <!--xsl:if test="$forID != ''"><xsl:text disable-output-escaping="yes"><label for="</xsl:text><xsl:value-of select="$forID"/><xsl:text disable-output-escaping="yes">"></xsl:text></xsl:if-->
- <xsl:apply-templates select="./hts:text"/>
- <!--xsl:if test="$forID != ''"><xsl:text disable-output-escaping="yes"></label></xsl:text></xsl:if-->
- </div>
- </td>
- </tr>
- <xsl:if test="./hts:hint">
- <xsl:apply-templates select="./hts:hint"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </table>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="hts:link">
- <xsl:variable name="linkClass">
- <xsl:choose>
- <xsl:when test="ancestor::hts:text[@format='hasLink']">cogstyle-layout-link-inplace</xsl:when>
- <xsl:when test="parent::hts:action">cogstyle-layout-link-action</xsl:when>
- <xsl:when test="parent::hts:section[@format='dynamicexpand']">cogstyle-layout-link-expand</xsl:when>
- <xsl:otherwise>cogstyle-layout-link</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="tabindex"><xsl:if test="./@tabindex"><xsl:value-of select="./@tabindex"/></xsl:if></xsl:variable>
- <xsl:text/><div>
- <!--xsl:if test="$tabindex != ''">
- <xsl:attribute name="tabindex"><xsl:value-of select="$tabindex"/></xsl:attribute>
- </xsl:if-->
- <xsl:attribute name="class"><xsl:value-of select="$linkClass"/></xsl:attribute>
- <!--xsl:if test="./@id">
- <xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
- </xsl:if-->
- <a class="cognos-anchor">
- <xsl:choose>
- <xsl:when test="@role!=''"><xsl:copy-of select="@role"/></xsl:when>
- <xsl:otherwise><xsl:attribute name="role"><xsl:text>link</xsl:text></xsl:attribute></xsl:otherwise>
- </xsl:choose>
- <!--xsl:if test="parent::hts:section[@format='dynamicexpand']">
- <xsl:attribute name="aria-expanded"><xsl:text>false</xsl:text></xsl:attribute>
- </xsl:if-->
- <xsl:copy-of select="@*[not(self::id)]"/>
- <xsl:text/><xsl:value-of select="string(.)"/><xsl:text/>
- </a>
- </div><xsl:text/>
- </xsl:template>
- <xsl:template match="hts:link[@type='button']">
- <xsl:variable name="btncls">
- <xsl:choose>
- <xsl:when test="not(@nospace)"><xsl:text>cogstyle-layout-button-spacing</xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>cogstyle-layout-button</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="display">
- <xsl:if test="./@display"><xsl:value-of select="./@display"/></xsl:if>
- </xsl:variable>
- <xsl:text/>
- <div class="{$btncls}" style="display:{$display}">
- <xsl:if test="./@id">
- <xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
- </xsl:if>
- <a role="button" class="portlet-form-button taskOptionButtons" onmouseout="javascript:this.className='taskOptionButtonsMouseOut taskOptionButtons'" onmouseover="javascript:this.className='taskOptionButtonsMouseOver taskOptionButtons'">
- <xsl:copy-of select="@*[not(self::id)]"/>
- <xsl:apply-templates select="./*[not(./@disabled='true')]"/>
- </a>
- </div>
- <div class="{$btncls}" style="display:none;'">
- <xsl:if test="./@id">
- <xsl:attribute name="id"><xsl:value-of select="./@id"/>_disabled</xsl:attribute>
- </xsl:if>
- <span class="portlet-form-button taskOptionButtons_hidden" onmouseover="javascript:this.className='taskOptionButtons_hiddenMouseOver taskOptionButtons_hidden'">
- <xsl:apply-templates select="./*[local-name() = 'value' or @disabled='true']"/>
- </span>
- </div>
- <xsl:text/>
- </xsl:template>
- <xsl:template match="hts:separator">
- <xsl:if test="./@type = 'vertical'">
- <div style="border-right-color: rgb(153,153,153);border-right-style: solid;border-right-width: 1px;height: 24px;padding-left: 10px;"/>
- </xsl:if>
- <xsl:if test="./@type = 'horizontal'">
- <xsl:variable name="width">
- <xsl:choose>
- <xsl:when test="./@width"><xsl:value-of select="./@width"/></xsl:when>
- <xsl:otherwise>5px</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <img role="separator" src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="{$width}"/>
- </xsl:if>
- </xsl:template>
- <xsl:template match="hts:option">
- <xsl:choose>
- <xsl:when test="parent::hts:select or parent::hts:optgroup">
- <option role="option">
- <xsl:copy-of select="@*"/>
- <xsl:value-of select="string(.)"/>
- </option>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="hts:optgroup">
- <xsl:choose>
- <xsl:when test="parent::hts:select">
- <optgroup label="{@label}">
- <xsl:apply-templates select="./*"/>
- </optgroup>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="hts:radio | hts:checkbox">
- <xsl:variable name="useRadioSR">
- <xsl:apply-templates select="./hts:keyscript"/>
- </xsl:variable>
- <xsl:variable name="rc" select="substring-after(string(name()),':')"/>
- <xsl:if test="(($rc='radio' and count(preceding-sibling::hts:radio)=0) or ($rc='checkbox' and count(preceding-sibling::hts:checkbox)=0))">
- <xsl:text disable-output-escaping="yes"><table role="presentation" cellpadding="0" cellspacing="0"></xsl:text>
- </xsl:if>
- <xsl:variable name="fId">
- <xsl:choose>
- <xsl:when test="string(@id)='' or string(@id) = '_THIS_'">
- <xsl:value-of select="concat('_THIS_',generate-id())"/>
- </xsl:when>
- <xsl:when test="contains(string(@id),'_THIS_')">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('_THIS_',@id)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <tr>
- <td class="cogstyle-layout-radio-chkbox-control">
- <input type="{$rc}" name="{@name}">
- <xsl:copy-of select="@*[name()!='id' and name()!='class' and name()!='selected']"/>
- <xsl:attribute name="id"><xsl:value-of select="$fId"/></xsl:attribute>
- <xsl:if test="string(@selected)='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="role">
- <xsl:choose>
- <xsl:when test="$rc='radio'"><xsl:text>radio</xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>checkbox</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:if test="$useRadioSR != ''">
- <xsl:attribute name="onclick"><xsl:value-of select="$useRadioSR"/></xsl:attribute>
- <xsl:attribute name="onkeypress"><xsl:value-of select="$useRadioSR"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="value"><xsl:apply-templates select="hts:value"/></xsl:attribute>
- </input>
- </td>
- <td class="cogstyle-layout-radio-chkbox-text"><label for="{$fId}" class="portlet-form-field"><xsl:apply-templates select="./hts:text"/></label></td>
- </tr>
- <xsl:if test="hts:rcsection">
- <tr>
- <td><br/></td>
- <td class="cogstyle-layout-in-radio-chkbox">
- <xsl:apply-templates select="./hts:rcsection"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="(($rc='radio' and count(following-sibling::hts:radio)=0) or ($rc='checkbox' and count(following-sibling::hts:checkbox)=0))">
- <xsl:text disable-output-escaping="yes"></table></xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="hts:rcsection">
- <div role="radiogroup"><xsl:apply-templates select="./*"/></div>
- </xsl:template>
-
- <xsl:template match="hts:rowset">
- <div class="cogstyle-layout-row">
- <xsl:variable name="rowFormat"><xsl:if test="@format"><xsl:value-of select="concat('cogstyle-layout-row-',@format)"/></xsl:if></xsl:variable>
- <xsl:variable name="width"><xsl:if test="@width"><xsl:value-of select="@width"/></xsl:if></xsl:variable>
- <xsl:variable name="cellpadding">
- <xsl:choose>
- <xsl:when test="./@cellpadding"><xsl:value-of select="./@cellpadding"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cellspacing">
- <xsl:choose>
- <xsl:when test="./@cellspacing"><xsl:value-of select="./@cellspacing"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <table cellpadding="{$cellpadding}" cellspacing="{$cellspacing}" role="presentation">
- <xsl:if test="$rowFormat != ''">
- <xsl:attribute name="class"><xsl:value-of select="$rowFormat"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$width != ''">
- <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="./*"/>
- </table>
- </div>
- </xsl:template>
-
- <xsl:template match="hts:row">
- <tr>
- <xsl:for-each select="./child::node()">
- <xsl:variable name="colspan"><xsl:if test="./@colspan"><xsl:value-of select="./@colspan"/></xsl:if></xsl:variable>
- <xsl:variable name="width"><xsl:if test="./@width"><xsl:value-of select="./@width"/></xsl:if></xsl:variable>
- <xsl:variable name="nowrap"><xsl:if test="./@nowrap"><xsl:value-of select="./@nowrap"/></xsl:if></xsl:variable>
- <!--xsl:variable name="tabindex"><xsl:if test="./@tabindex"><xsl:value-of select="./@tabindex"/></xsl:if></xsl:variable-->
- <xsl:variable name="class">
- <xsl:choose>
- <xsl:when test="./@class"><xsl:value-of select="./@class"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="'cogstyle-layout-rows'"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <td class="{$class}">
- <xsl:if test="$colspan != ''">
- <xsl:attribute name="colspan"><xsl:value-of select="$colspan"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$width != ''">
- <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$nowrap != ''">
- <xsl:attribute name="nowrap"><xsl:value-of select="$nowrap"/></xsl:attribute>
- </xsl:if>
- <!--xsl:if test="$tabindex != ''">
- <xsl:attribute name="tabindex"><xsl:value-of select="$tabindex"/></xsl:attribute>
- </xsl:if-->
- <div class="portlet-form-field">
- <xsl:apply-templates select="."/>
- </div>
- </td>
- </xsl:for-each>
- </tr>
- </xsl:template>
- <xsl:template match="hts:row[@format='header']">
- <xsl:variable name="rowClass"><xsl:if test="./@class"><xsl:value-of select="./@class"/></xsl:if></xsl:variable>
- <tr>
- <xsl:if test="$rowClass != ''">
- <xsl:attribute name="class"><xsl:value-of select="$rowClass"/></xsl:attribute>
- </xsl:if>
- <xsl:for-each select="./child::node()">
- <xsl:variable name="colspan"><xsl:if test="./@colspan"><xsl:value-of select="./@colspan"/></xsl:if></xsl:variable>
- <xsl:variable name="width"><xsl:if test="./@width"><xsl:value-of select="./@width"/></xsl:if></xsl:variable>
- <th>
- <xsl:if test="$colspan != ''">
- <xsl:attribute name="colspan"><xsl:value-of select="$colspan"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$width != ''">
- <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
- </xsl:if>
- <div class="portlet-form-field">
- <xsl:apply-templates select="."/>
- </div>
- </th>
- </xsl:for-each>
- </tr>
- </xsl:template>
- <xsl:template match="hts:script">
- <xsl:variable name="stype">
- <xsl:choose>
- <xsl:when test="@type"><xsl:value-of select="@type"/></xsl:when>
- <xsl:otherwise>text/javascript</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <script type="{string($stype)}">
- <xsl:copy-of select="./child::node()"/>
- </script>
- </xsl:template>
- <xsl:template match="hts:section[@format='dynamicexpand']">
- <xsl:variable name="deVu">
- <xsl:choose>
- <xsl:when test="string(@defaultview)!='' and string(@defaultview)!='none'">cogstyle-layout-dynamic-expand</xsl:when>
- <xsl:otherwise>cogstyle-layout-dynamic-collapse</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="deVuCollapsed">
- <xsl:if test="./hts:dynamicareacollapsed">
- <xsl:choose>
- <xsl:when test="$deVu = 'cogstyle-layout-dynamic-collapse'">cogstyle-layout-dynamic-expand</xsl:when>
- <xsl:otherwise>cogstyle-layout-dynamic-collapse</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="cId">
- <xsl:if test="@id">
- <xsl:choose>
- <xsl:when test="contains(string(@id),'_THIS_')">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('_THIS_',@id)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="cName" select="@name"/>
- <xsl:apply-templates select="./hts:script"/>
- <table cellpadding="0" cellspacing="0" class="cogstyle-layout-wide" role="presentation">
- <tr>
- <td class="cogstyle-layout-label">
- <xsl:apply-templates select="./hts:link"/>
- <xsl:apply-templates select="./hts:img"/>
- </td>
- </tr>
- <xsl:if test="./hts:hint">
- <tr>
- <td>
- <xsl:apply-templates select="./hts:hint"/>
- </td>
- </tr>
- </xsl:if>
- </table>
- <div>
- <xsl:attribute name="class"><xsl:value-of select="$deVu"/></xsl:attribute>
- <xsl:attribute name="id"><xsl:value-of select="$cId"/></xsl:attribute>
- <xsl:attribute name="name"><xsl:value-of select="$cName"/></xsl:attribute>
- <xsl:apply-templates select="./hts:dynamicarea/*"/>
- </div>
- <xsl:if test="./hts:dynamicareacollapsed">
- <div>
- <xsl:attribute name="class"><xsl:value-of select="$deVuCollapsed"/></xsl:attribute>
- <xsl:attribute name="id"><xsl:value-of select="$cId"/>_collapsed</xsl:attribute>
- <xsl:attribute name="name"><xsl:value-of select="$cName"/>_collapsed</xsl:attribute>
- <xsl:apply-templates select="./hts:dynamicareacollapsed/*"/>
- </div>
- </xsl:if>
- </xsl:template>
- <xsl:template match="hts:section[@format='header']">
- <table width="100%" role="presentation">
- <tr>
- <td width="100%"><div class="portlet-msg-info"><xsl:apply-templates select="./hts:text"/></div></td>
- <xsl:if test="./hts:action or ./hts:actionlist">
- <td class="cogstyle-layout-action-list"><xsl:apply-templates select="./hts:action | ./hts:actionlist"/></td>
- </xsl:if>
- </tr>
- </table>
- </xsl:template>
- <xsl:template match="hts:section[@format='select-locale']">
- <xsl:apply-templates select="./hts:script"/>
- <xsl:apply-templates select="./hts:hidden"/>
- <xsl:choose>
- <xsl:when test="string(@divider)='true'">
- <xsl:text disable-output-escaping="yes"><div class="cogstyle-layout-divider-line"></xsl:text>
- <xsl:if test="./hts:label">
- <div class="cogstyle-layout-select-locale-label"><xsl:apply-templates select="./hts:label"/></div>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <div class="cogstyle-layout-select-locale-label"><xsl:apply-templates select="./hts:label"/></div>
- </xsl:otherwise>
- </xsl:choose>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td class="cogstyle-layout-select-locale-row">
- <div class="cogstyle-layout-select-locale">
- <xsl:apply-templates select="./hts:select"/>
- </div>
- <div class="cogstyle-layout-select-locale-text">
- <a class="cognos-anchor" href="#">
- <xsl:attribute name="onclick"><xsl:value-of select="./hts:removelocaleaction"/></xsl:attribute>
- <xsl:text/><xts:string id="IDS_PROP_REMOVE_LANGUAGE_TEXT"/><xsl:text/>
- </a>
- </div>
- </td>
- </tr>
- </table>
- <xsl:if test="string(@divider)='true'">
- <xsl:text disable-output-escaping="yes"></div></xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="hts:section[@format='division']">
- <table>
- <tr>
- <xsl:if test="./hts:label">
- <td class="cogstyle-layout-divider-label">
- <div class="portlet-form-field-label">
- <xsl:apply-templates select="./hts:label/hts:text"/>
- </div>
- </td>
- </xsl:if>
- <td class="cogstyle-layout-divider"><div class="cogstyle-layout-divider-line"></div></td>
- </tr>
- </table>
- <div><xsl:apply-templates select="./*[not(name()='hts:label')]"/></div>
- </xsl:template>
-
- <xsl:template match="hts:section">
- <xsl:variable name="style" select="@style"/>
- <xsl:variable name="inRC" select="preceding-sibling::*[name()='hts:radio' or name()='hts:checkbox']"/>
- <xsl:variable name="rsFormat"><xsl:if test="@format"><xsl:value-of select="concat('-',@format)"/></xsl:if></xsl:variable>
- <xsl:variable name="cls">
- <xsl:choose>
- <xsl:when test="not(@class)">cogstyle-layout-section<xsl:value-of select="$rsFormat"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="fId">
- <xsl:if test="@id">
- <xsl:choose>
- <xsl:when test="contains(string(@id),'_THIS_')"><xsl:value-of select="@id"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('_THIS_',@id)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
- <xsl:if test="$inRC">
- <xsl:text disable-output-escaping="yes">
- <tr><td><br/><td>
- </xsl:text>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="string(@divider)='true'">
- <div class="cogstyle-layout-divider-line">
- <xsl:if test="$style != ''">
- <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$fId != ''">
- <xsl:attribute name="id"><xsl:value-of select="$fId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./hts:hint">
- <div><xsl:apply-templates select="./hts:hint"/></div>
- </xsl:if>
- <div class="{$cls}"><xsl:apply-templates select="./*[not(name()='hts:hint')]"/></div>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <div class="{$cls}">
- <xsl:if test="$style != ''">
- <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$fId != ''">
- <xsl:attribute name="id"><xsl:value-of select="$fId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./hts:hint">
- <div><xsl:apply-templates select="./hts:hint"/></div>
- </xsl:if>
- <xsl:apply-templates select="./*[not(name()='hts:hint')]"/>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$inRC">
- <xsl:text disable-output-escaping="yes">
- </td></tr>
- </xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="hts:select">
- <xsl:variable name="useSelectSR">
- <xsl:apply-templates select="./hts:keyscript"/>
- </xsl:variable>
- <xsl:variable name="fId">
- <xsl:choose>
- <xsl:when test="contains(string(@id),'_THIS_')">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('_THIS_',string(@id))"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="./hts:label">
- <xsl:apply-templates select="./hts:label"/>
- </xsl:if>
- <xsl:if test="not(parent::hts:section[@format='select-locale'])">
- <xsl:text disable-output-escaping="yes"><table role="presentation" width="100%">
- <tr>
- <td></xsl:text>
- </xsl:if>
- <select role="listbox">
- <xsl:copy-of select="@*[name()!='id' and name()!='name']"/>
- <xsl:if test="@id">
- <xsl:attribute name="id"><xsl:value-of select="$fId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@name">
- <xsl:attribute name="name"><xsl:value-of select="concat('_THIS_',string(@name))"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$useSelectSR != ''">
- <xsl:attribute name="onchange"><xsl:value-of select="$useSelectSR"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="./hts:option">
- <xsl:apply-templates select="./hts:option | ./hts:optgroup"/>
- </xsl:when>
- <xsl:when test="./option">
- <xsl:copy-of select="./*[name()='option'] | ./*[name()='optgroup']"/>
- </xsl:when>
- </xsl:choose>
- </select>
- <xsl:if test="not(parent::hts:section[@format='select-locale'])"><xsl:text disable-output-escaping="yes">
- </td>
- </tr>
- </table></xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="hts:text | hts:value">
- <xsl:choose>
- <xsl:when test="@label-for != ''">
- <label for="{@label-for}"><xsl:text/><xsl:value-of select="string(.)"/><xsl:text/></label>
- </xsl:when>
- <xsl:when test="@format='hasLink'">
- <xsl:apply-templates select="*|text()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/><xsl:value-of select="string(.)"/><xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="hts:span">
- <span role="presentation">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="./*"/>
- </span>
- </xsl:template>
-
- <xsl:template match="hts:div">
- <div role="presentation">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates select="./*"/>
- </div>
- </xsl:template>
-
- <xsl:template match="hts:*">
- <xsl:message terminate="yes">ERR-LAY-001: Unsupported layout tag: <xsl:value-of select="name()"/>.</xsl:message>
- </xsl:template>
- <!-- CALLED TEMPLATES -->
- <xsl:template name="createHiddenField">
- <xsl:param name="chfName" select="''"/>
- <xsl:param name="chfId" select="''"/>
- <xsl:param name="chfValue" select="''"/>
- <xsl:variable name="lchfId">
- <xsl:if test="$chfId != ''">
- <xsl:choose>
- <xsl:when test="contains(string($chfId),'_THIS_')">
- <xsl:value-of select="$chfId"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('_THIS_',$chfId)"/></xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
- <xsl:text/><input type="hidden"><xsl:text/>
- <xsl:if test="$lchfId != ''">
- <xsl:attribute name="id"><xsl:value-of select="$lchfId"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$chfName != ''">
- <xsl:attribute name="name"><xsl:value-of select="$chfName"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="value"><xsl:value-of select="$chfValue"/></xsl:attribute>
- <xsl:text/></input>
- </xsl:template>
-
- <xsl:template name="replaceLinkInText">
- <xsl:param name="text"/>
- <xsl:param name="node"/>
- <xsl:param name="linkNumber"/>
- <xsl:choose>
- <xsl:when test="$linkNumber!=''">
- <xsl:variable name="constant" select="concat('##link',$linkNumber,'##')"/>
- <xsl:variable name="stringBefore" select="substring-before($text,$constant)"/>
- <xsl:variable name="stringAfter" select="substring-after($text,$constant)"/>
- <xsl:value-of select="$stringBefore"/>
- <xsl:apply-templates select="$node/hts:links/*[name()='hts:link'][number($linkNumber)]"/>
- <xsl:variable name="newLinkNumber" select="substring-before(substring-after($stringAfter,'##link'),'##')"/>
- <xsl:call-template name="replaceLinkInText">
- <xsl:with-param name="text" select="$stringAfter"/>
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="linkNumber" select="$newLinkNumber"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$text"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Non-layout processing -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|