123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2011
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!-- $Header: //cpscrn/main/templates/cps4/producer/logicsheets/cps-formlogic.xslt#1 $ -->
- <!-- $DateTime: 2008/10/22 11:12:04 $ -->
- <!-- $Change: 25109 $ -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:out="dummy-uri"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/">
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:variable name="utml-namespace-uri" select="'http://developer.cognos.com/schemas/cps/logic/form/1/'"/>
- <xsl:variable name="utml-nav-stack-delimiter" select="'*'"/>
- <xsl:variable name="utml-nav-stack-mode-delimiter" select="'|'"/>
- <!--
- List of supported tags (see each template for details):
- utml:form
- utml:form-submit
- utml:rewrite-render
- utml:input
- utml:textarea
- utml:radio-group
- utml:select
- utml:option
- utml:a
- utml:group
- utml:variables
- -->
- <!-- =========================================================== -->
- <!-- ========================= form ============================ -->
- <!-- =========================================================== -->
- <!--
- Just like formlogic formlogic lite will add evironment variables as
- that aren't in the current page as utml fields as hidden inputs
- - you can have fields not add a hidden input by defining an exclude or exclude prefix
- <utml:form ...
- <utml:exclude>excludefieldname</utml:exclude>
- <utml:exclude-prefix>excludeprefix</utml:excludeprefix>
- -->
- <xsl:template match="utml:form" priority="1">
- <form>
- <!-- copy non-utml attributes... -->
- <xsl:copy-of select="@*[namespace-uri() != $utml-namespace-uri]"/>
- <!-- define the delimiter so we know how tot get the tarked from the stack string -->
- <out:variable name="stack-down-target">
- <out:choose>
- <out:when test="contains( key('utml-key-params', 'edit_stack'), '{$utml-nav-stack-delimiter}')">
- <out:value-of select="substring-before( key('utml-key-params', 'edit_stack'), '{$utml-nav-stack-delimiter}' )"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="key('utml-key-params', 'edit_stack')"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <xsl:variable name="formName"><xsl:value-of select="@name"/></xsl:variable>
- <out:variable name="{$formName}form">
- <xsl:copy-of select="utml:read-only/child::node()"/>
- </out:variable>
- <!-- handle children... -->
- <xsl:apply-templates/>
- <!-- this will get all the current utml inputs -->
- <xsl:variable name="existence-test-string">
- <xsl:for-each select="//utml:input[not(@type = 'button') and not( (@type = 'radio') and ancestor::*[name() = 'utml:radio-group'] )] | //utml:textarea | //utml:select | //utml:radio-group">
- <xsl:text/> and @name != '<xsl:value-of select="./@name"/>' <xsl:text/>
- </xsl:for-each>
- <xsl:for-each select="//utml:form/utml:exclude">
- <xsl:text/> and @name != '<xsl:value-of select="."/>' <xsl:text/>
- </xsl:for-each>
- </xsl:variable>
- <!-- this will allow you to specigy a prefix to exclude hidden inputs for -->
- <xsl:variable name="exclude-prefixes">
- <xsl:for-each select=".//utml:exclude-prefix">
- <xsl:text>starts-with(@name, '</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>') or </xsl:text>
- </xsl:for-each>
- <xsl:text>false()</xsl:text>
- </xsl:variable>
- <!-- loop through the environment and add hidden inputs for unused info to be passed along -->
- <out:for-each select="$utml-params[not({$exclude-prefixes})]">
- <out:if test="@name != '' {$existence-test-string}">
- <input type="hidden">
- <xsl:attribute name="name"><xsl:value-of select="'{@name}'"/></xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of select="'{.}'"/></xsl:attribute>
- </input>
- </out:if>
- </out:for-each>
- <!-- Comma-delimited list of template names representing a set of stacked dialogs resulting from a "push" or a "stack-up" navigation operations. -->
- <xsl:if test="not(//utml:input[@name = 'edit_stack'])">
- <out:if test="not( key('utml-key-params', 'edit_stack') )">
- <input type="hidden" name="edit_stack" value=""/>
- </out:if>
- </xsl:if>
- <!-- The name of the current template. This is used by formlogic-init to determine where we came from to update the navigation stack. -->
- <xsl:if test="not(//utml:input[@name = 'edit_mode'])">
- <out:if test="not( key('utml-key-params', 'edit_mode') )">
- <input type="hidden" name="edit_mode" value=""/>
- </out:if>
- </xsl:if>
- <xsl:if test="not(//utml:input[@name = 'edit_name'])">
- <out:if test="not( key('utml-key-params', 'edit_name') )">
- <input type="hidden" name="edit_name">
- <out:attribute name="value">
- <out:value-of select="$utml-mode"/>
- <out:text>|edit</out:text>
- </out:attribute>
- </input>
- </out:if>
- </xsl:if>
- <xsl:if test="not(//utml:input[@name = 'edit_visited'])">
- <out:if test="not( key('utml-key-params', 'edit_visited') )">
- <input type="hidden" name="edit_visited" value="true"/>
- </out:if>
- </xsl:if>
- <xsl:if test="@utml:escape-prefix != ''">
- <out:if test="{ @utml:escape-prefix } != ''">
- <script language="javascript">
- function <xsl:value-of select="@name"/>_escape_fields() {
- var prefix = "<out:value-of select="{ @utml:escape-prefix }"/>";
- var c = document.<xsl:value-of select="@name"/>.elements.length;
- var i;
- for (i=0; i < c; i++) {
- var e = document.<xsl:value-of select="@name"/>.elements[i];
- if (e.name.substring(0, prefix.length) == prefix) {
- var s = e.name.substring(prefix.length);
- var c2 = document.<xsl:value-of select="@name"/>.elements.length;
- var i2;
- for (i2=0; i2<c2; i2++) {
- var e2 = document.<xsl:value-of select="@name"/>.elements[i2];
- if (e2.name == s) {
- e.value = <xsl:value-of select="@name"/>_urlUnicodeEncode( e2.value );
- }
- }
- }
- }
- }
- function <xsl:value-of select="@name"/>_urlUnicodeEncode( str ) {
- var len = str.length;
- var out = "";
- var i;
- for (i = 0; i < len; i++) {
- var c = str.charCodeAt( i );
- if (c == 0x25) {
- out += "%%";
- } else if (c <= 0x7f) {
- out += str.charAt( i );
- } else {
- var e = c.toString( 16 );
- out += "%u" + ("0000" + e).substring(e.length);
- }
- }
- return out;
- }
- </script>
- </out:if>
- </xsl:if>
- <xsl:if test="@utml:maintainPrevNavState = 'true'">
- <out:if test="not( key('utml-key-params', 'edit_navState') )">
- <out:variable name="utml-navState">
- <out:for-each select="$utml-params">
- <out:text><param name="</out:text>
- <out:value-of select="@name"/>
- <out:text>"></out:text>
- <out:value-of select="xtsext:xmlencode(string(.))"/>
- <out:text></param></out:text>
- </out:for-each>
- </out:variable>
- <input type="hidden" name="edit_navState" value="{ '{ xtsext:validator("prepare","edit_navState",xtsext:base64encode( string( $utml-navState ), true() )) }' }"/>
- </out:if>
- </xsl:if>
- </form>
- </xsl:template>
- <!-- =========================================================== -->
- <!-- ====================== form-subit ========================= -->
- <!-- =========================================================== -->
- <!--
- <utml:form-submit
- utml:formName = "the-form-name" mandatory
- utml:targetPage = "the-sub-mode" default: <blank> values: ...
- utml:mode = "the-wsrp-mode" default: <blank> values: wsrp:view, wsrp:edit, wsrp:help, wsrp:preview, cps:config
- utml:operation = "the-wsrp-interactionState" default: <blank> values: pop, drop, maintain, ...
- utml:urlType = "the-wsrp-urlType" default: blockingAction values: render, blockingAction
- utml:validate = "true|false"/> default: false
- -->
- <xsl:template match="utml:form-submit" name="utml-gen-form-submit" priority="1">
- <xsl:param name="formName">
- <xsl:choose>
- <xsl:when test="@utml:formName">
- <xsl:value-of select="@utml:formName"/>
- </xsl:when>
- <xsl:when test="ancestor::utml:form">
- <xsl:value-of select="ancestor::utml:form/@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">UTML ERROR: can't find the embedded form name.</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="targetPage" select="@utml:targetPage"/>
- <xsl:param name="operation" select="@utml:operation"/>
- <xsl:param name="validate" select="@utml:validate"/>
- <xsl:param name="mode" select="@utml:mode"/>
- <xsl:param name="urlType" select="@utml:urlType"/>
- <xsl:if test="$operation = 'pop' or $operation = 'drop'">
- <out:variable name="stack-down-target{generate-id()}">
- <out:choose>
- <out:when test="contains( key('utml-key-params', 'edit_stack'), '{$utml-nav-stack-delimiter}')">
- <out:value-of select="substring-before( key('utml-key-params', 'edit_stack'), '{$utml-nav-stack-delimiter}' )"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="key('utml-key-params', 'edit_stack')"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- </xsl:if>
- <xsl:if test="$validate = 'true'">
- <xsl:text>
- if ( window.wsrp_rewrite_validate ) {
- if ( !wsrp_rewrite_validate() ) {
- return;
- }
- }
- </xsl:text>
- </xsl:if>
- <xsl:text>
- if ( window.wsrp_rewrite_presubmit ) {
- wsrp_rewrite_presubmit('</xsl:text>
- <xsl:value-of select="$operation"/>
- <xsl:text>');
- }
- </xsl:text>
- <xsl:if test="//utml:form[@name = $formName]/@utml:escape-prefix">
- <out:if test="{ //utml:form[@name = $formName]/@utml:escape-prefix }">
- <xsl:value-of select="$formName"/>
- <xsl:text>_escape_fields();</xsl:text>
- </out:if>
- </xsl:if>
- <xsl:text>document.</xsl:text>
- <xsl:value-of select="$formName"/>
- <xsl:text>.action="wsrp_rewrite?wsrp-urlType=</xsl:text>
- <xsl:choose>
- <xsl:when test="$urlType != ''">
- <xsl:value-of select="$urlType"/>
- </xsl:when>
- <xsl:otherwise>blockingAction</xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$operation != ''">
- <xsl:text>&wsrp-interactionState=</xsl:text>
- <xsl:value-of select="$operation"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$mode != ''">
- <xsl:text>&wsrp-mode=</xsl:text>
- <xsl:value-of select="$mode"/>
- </xsl:when>
- <xsl:when test="$operation = 'pop' or $operation = 'drop'">
- <!-- PATCH ALERT #415036.0: we do this work here, because some consumers must decide the wsrp-mode @
- wsrp_rewrite generation time, not @ blockingAction time. -->
- <xsl:text>&wsrp-mode=</xsl:text>
- <out:choose>
- <out:when test="contains( $stack-down-target{generate-id()}, '{$utml-nav-stack-mode-delimiter}' )">
- <out:value-of select="substring-before( $stack-down-target{generate-id()}, '{$utml-nav-stack-mode-delimiter}' )"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$utml-mode"/>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:when test="$operation = 'maintain' or $operation = 'push'">
- <xsl:text>&wsrp-mode=</xsl:text>
- <out:value-of select="$utml-mode"/>
- </xsl:when>
- </xsl:choose>
- <xsl:text>/wsrp_rewrite";</xsl:text>
- <xsl:choose>
- <xsl:when test="$targetPage != ''">
- <xsl:text>document.</xsl:text>
- <xsl:value-of select="$formName"/>
- <xsl:text>.edit_mode.value="</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode($targetPage)"/>
- <xsl:text>";</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$operation = 'pop' or $operation = 'drop'">
- <xsl:text>document.</xsl:text>
- <xsl:value-of select="$formName"/>
- <xsl:text>.edit_mode.value='</xsl:text>
- <out:value-of xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" select="xtsext:javascriptencode($stack-down-target{generate-id()})"/>
- <xsl:text>';</xsl:text>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>document.</xsl:text>
- <xsl:value-of select="$formName"/>
- <xsl:text>.submit();</xsl:text>
- </xsl:template>
- <!-- =========================================================== -->
- <!-- ===================== rewrite-render ====================== -->
- <!-- =========================================================== -->
- <!--
- <utml:rewrite-render
- utml:mode = "the-wsrp-mode" default: wsrp:view values: wsrp:view, wsrp:edit, wsrp:help, wsrp:preview, cps:config
- />
- -->
- <xsl:template match="utml:rewrite-render" priority="1">
- <xsl:variable name="mode" select="@utml:mode"/>
- <out:text>document.location.href = "wsrp_rewrite?wsrp-urlType=render&wsrp-mode=</out:text>
- <xsl:choose>
- <xsl:when test="$mode != ''">
- <xsl:value-of select="$mode"/>
- </xsl:when>
- <xsl:otherwise>wsrp:view</xsl:otherwise>
- </xsl:choose>
- <out:text>&wsrp-navigationalState=</out:text>
- <out:choose>
- <out:when test="key('utml-key-params', 'edit_navState')">
- <out:value-of select="xtsext:urlencode( string(key( 'utml-key-params', 'edit_navState' ) ) )"/>
- </out:when>
- <out:otherwise>
- <out:variable name="utml-navState">
- <out:for-each select="$utml-params">
- <out:text><param name="</out:text>
- <out:value-of select="@name"/>
- <out:text>"></out:text>
- <out:value-of select="xtsext:xmlencode(string(.))"/>
- <out:text></param></out:text>
- </out:for-each>
- </out:variable>
- <out:value-of select="xtsext:urlencode( xtsext:validator('prepare','utml-navState',xtsext:base64encode( string( $utml-navState ), true() ) ))"/>
- </out:otherwise>
- </out:choose>
- <xsl:text>/wsrp_rewrite";</xsl:text>
- </xsl:template>
- <!-- ========================================================== -->
- <!-- ======================= Input ============================ -->
- <!-- ========================================================== -->
- <!--
- <utml:input type="text|password|hidden" name="fieldname" (value="fieldvalue") utml:update="false|true">
- <utml:read-only>....</utml:read-only>
- (<utml:value>....</utml:value>) - other place for value
- </utml:input>
- Notes:
- -not having a readonly node will cut a lot of code out during the compile
- -value can be listed as an attribute or a child node
- -update will make the code smaller when set to false, this will not grab
- the environment value for the variable if found
- -->
- <xsl:template match="utml:input[(@type = 'text') or (@type = 'password') or (@type = 'hidden')]" priority="1">
- <!-- if there isn't a readonly node don't include the extra logic into the stylesheet -->
- <xsl:choose>
- <xsl:when test="((utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only)) and not (@type = 'hidden')">
- <out:variable name="{@name}read-only">
- <xsl:choose>
- <xsl:when test="(utml:read-only)">
- <xsl:copy-of select="utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:when test="(ancestor::*[name() = 'utml:group']/utml:read-only/child::node())">
- <xsl:copy-of select="ancestor::*[name() = 'utml:group']/utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="ancestor::*[name() = 'utml:form']/utml:read-only/child::node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:choose>
- <out:when test="${@name}read-only = 'true'">
- <xsl:choose>
- <xsl:when test="@type = 'password'">***************</xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-input-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </out:when>
- <out:otherwise>
- <xsl:call-template name="utml-render-input">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-render-input">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- render the input field again using all the original attributes -->
- <xsl:template name="utml-render-input">
- <xsl:param name="node"/>
- <input>
- <xsl:copy-of select="@*[(local-name() != 'value') and namespace-uri() != $utml-namespace-uri]"/>
- <out:variable name="updatedValue">
- <xsl:choose>
- <xsl:when test="@utml:update='false'">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-input-value">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:attribute name="value">
- <out:value-of select="$updatedValue"/>
- </out:attribute>
- <out:variable name="textDirection">
- <out:choose>
- <out:when test="$ui-portlet-isBidiEnabled != 'true'"></out:when>
- <out:otherwise>
- <xsl:choose>
- <xsl:when test="$node[@dir]"></xsl:when>
- <xsl:when test="$node[@stttype]">stt</xsl:when>
- <xsl:otherwise>
- <out:value-of select="xtsext:getBTD(string($updatedValue), $ui-portlet-baseTextDirection, $ui-portlet-product-locale)"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <xsl:if test="$node[@type = 'text']">
- <out:if test="$textDirection != ''">
- <out:choose>
- <out:when test="$textDirection = 'stt'">
- <out:attribute name="dir">ltr</out:attribute>
- </out:when>
- <out:otherwise>
- <out:attribute name="dir">
- <out:value-of select="$textDirection"/>
- </out:attribute>
- </out:otherwise>
- </out:choose>
- <out:if test="$textDirection = 'stt' or $ui-portlet-baseTextDirection = 'auto'">
- <xsl:choose>
- <xsl:when test="$node[@onfocus]">
- <out:attribute name="onfocus">
- <xsl:value-of select="concat('bidi.onfocus(this);',$node[@onfocus])"/>
- </out:attribute>
- </xsl:when>
- <xsl:otherwise>
- <out:attribute name="onfocus">
- <out:text>bidi.onfocus(this)</out:text>
- </out:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </out:if>
- </out:if>
- </xsl:if>
- <xsl:apply-templates/>
- </input>
- <xsl:call-template name="utml-render-escaped-input">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:template>
- <!-- render the input field again using all the original attributes -->
- <xsl:template name="utml-render-textarea">
- <xsl:param name="node"/>
- <textarea>
- <xsl:copy-of select="@*[(local-name() != 'value') and namespace-uri() != $utml-namespace-uri]"/>
- <xsl:choose>
- <xsl:when test="@utml:update='false'">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-input-value">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates/>
- </textarea>
- <xsl:call-template name="utml-render-escaped-input">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="utml-render-escaped-input">
- <xsl:param name="node"/>
- <xsl:if test="@utml:escape = 'true'">
- <xsl:variable name="utml-escape-prefix">
- <xsl:choose>
- <xsl:when test="ancestor::utml:form">
- <xsl:value-of select="ancestor::utml:form/@utml:escape-prefix"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@utml:escape-prefix"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <out:if test="{ $utml-escape-prefix } != ''">
- <input name="{ '{ ' }{ $utml-escape-prefix }{ ' }' }{ @name }" type="hidden" value=""/>
- </out:if>
- </xsl:if>
- </xsl:template>
- <!-- find out where you should get the value from -->
- <xsl:template name="utml-input-value">
- <xsl:param name="node"/>
- <out:choose>
- <out:when test="key('utml-key-params', '{$node/@name}')">
- <out:value-of select="key('utml-key-params', '{$node/@name}')"/>
- </out:when>
- <out:otherwise>
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
- </out:otherwise>
- </out:choose>
- </xsl:template>
- <!-- is compile time code to find out where you put the value -->
- <xsl:template name="utml-get-value">
- <xsl:param name="node"/>
- <xsl:choose>
- <xsl:when test="$node/@value">
- <xsl:value-of select="$node/@value"/>
- </xsl:when>
- <xsl:when test="$node/@utml:value">
- <out:value-of select="{$node/@utml:value}"/>
- </xsl:when>
- <xsl:when test="$node/utml:value">
- <xsl:copy-of select="$node/utml:value/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ============================================================== -->
- <!-- ========================= Textarea =========================== -->
- <!-- ============================================================== -->
- <!--
- <utml:textarea name="fieldname" (value="fieldvalue") utml:update="false|true">
- <utml:read-only>....</utml:read-only>
- (<utml:value>....</utml:value>) - other place for value
- </utml:input>
- Notes:
- -not having a readonly node will cut a lot of code out during the compile
- -value can be listed as an attribute or a child node
- -update will make the code smaller when set to false, this will not grab
- the environment value for the variable if found
- -->
- <xsl:template match="utml:textarea" priority="1">
- <!-- if there isn't a readonly node don't include the extra logic into the stylesheet -->
- <xsl:choose>
- <xsl:when test="(utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only)">
- <out:variable name="{@name}read-only">
- <xsl:choose>
- <xsl:when test="(utml:read-only)">
- <xsl:copy-of select="utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:when test="(ancestor::*[name() = 'utml:group']/utml:read-only/child::node())">
- <xsl:copy-of select="ancestor::*[name() = 'utml:group']/utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="ancestor::*[name() = 'utml:form']/utml:read-only/child::node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:choose>
- <out:when test="${@name}read-only = 'true'">
- <xsl:call-template name="utml-input-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:when>
- <out:otherwise>
- <xsl:call-template name="utml-render-textarea">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-render-textarea">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- =============================================== -->
- <!-- ================= Radio Group ================= -->
- <!-- =============================================== -->
- <!--
- <utml:radio-group name="radiobuttonsfieldname">
- <utml:read-only>....</utml:read-only>
- <utml:default-value>....</utml:default-value>
- ...
- </utml:radio-group>
- Notes:
- -the variables created for this will use the name of the group as a prefix
- -default-value allows you to specify the default selected value
- -readonly can be set for the entire group of individual buttons
- -update='false' will not grab the environment value for the variable if found
- -->
- <xsl:template match="utml:radio-group" priority="1">
- <!-- this will prefix all the radio group variable so they have unique names -->
- <xsl:variable name="group-prefix">
- <xsl:choose>
- <xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <out:variable name="{$group-prefix}read-only">
- <xsl:choose>
- <xsl:when test="(utml:read-only)">
- <xsl:copy-of select="utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:when test="(ancestor::*[name() = 'utml:group']/utml:read-only/child::node())">
- <xsl:copy-of select="ancestor::*[name() = 'utml:group']/utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="ancestor::*[name() = 'utml:form']/utml:read-only/child::node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:variable name="{$group-prefix}checked-value">
- <out:choose>
- <out:when test="key('utml-key-params', '{@name}')"><out:value-of select="key('utml-key-params', '{@name}')"/></out:when>
- <out:otherwise><xsl:copy-of select="utml:default-value/child::node()"/></out:otherwise>
- </out:choose>
- </out:variable>
- <xsl:apply-templates/>
- </xsl:template>
- <!-- =============================================== -->
- <!-- ===================== Radio =================== -->
- <!-- =============================================== -->
- <!--
- <utml:input type="radio" (value="fieldvalue") *name="radiobuttonsfieldname"> *- if named make if the same as the group
- <utml:read-only>....</utml:read-only>
- (<utml:value>....</utml:value>) - other place for the value
- ...
- </utml:radio-group>
- Notes:
- -if the value of the radio button isn't dynamic use the attribute and the code becomes smaller
- -->
- <xsl:template match="utml:input[(@type = 'radio')]" priority="1">
- <!-- the button names should match that of the group so all group variables will need this prefix -->
- <xsl:variable name="group-prefix">
- <xsl:choose>
- <xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="ancestor::*[name() = 'utml:radio-group']/@name"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="no-update" select="ancestor::*[name() = 'utml:radio-group']/@utml:update='false'"/>
- <!-- if it isn't readonly and the value is hardcoded don't add extra logic -->
- <xsl:choose>
- <xsl:when test="@value and not((ancestor::*[name() = 'utml:radio-group']/utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only))">
- <input name="{$group-prefix}">
- <xsl:choose>
- <xsl:when test="$no-update">
- <xsl:copy-of select="@*[(local-name() != 'name') and namespace-uri() != $utml-namespace-uri]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="@*[(local-name() != 'checked') and (local-name() != 'name') and namespace-uri() != $utml-namespace-uri]"/>
- <out:if test="'{@value}' = ${$group-prefix}checked-value"><out:attribute name="checked">checked</out:attribute></out:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates/>
- </input>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="radio-prefix">
- <xsl:value-of select="concat($group-prefix, position())"/>
- </xsl:variable>
- <out:variable name="{$radio-prefix}value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:variable>
- <xsl:choose>
- <xsl:when test="(ancestor::*[name() = 'utml:radio-group']/utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only)">
- <out:choose>
- <out:when test="${$group-prefix}read-only = 'true'">
- <img>
- <out:attribute name="src">
- <out:value-of select="$image_root"/>icon_disabled_radio_<out:if test="${$radio-prefix}value != ${$group-prefix}checked-value">un</out:if>checked.gif</out:attribute>
- </img>
- </out:when>
- <out:otherwise>
- <input name="{$group-prefix}">
- <xsl:choose>
- <xsl:when test="$no-update">
- <xsl:copy-of select="@*[(local-name() != 'name') and namespace-uri() != $utml-namespace-uri]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="@*[(local-name() != 'value') and (local-name() != 'name') and (local-name() != 'checked') and namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:attribute>
- <out:if test="${$radio-prefix}value = ${$group-prefix}checked-value"><out:attribute name="checked">checked</out:attribute></out:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates/>
- </input>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:otherwise>
- <input name="{$group-prefix}">
- <xsl:choose>
- <xsl:when test="$no-update">
- <xsl:copy-of select="@*[(local-name() != 'name') and namespace-uri() != $utml-namespace-uri]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="@*[(local-name() != 'value') and (local-name() != 'name') and (local-name() != 'checked') and namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:attribute>
- <out:if test="${$radio-prefix}value = ${$group-prefix}checked-value"><out:attribute name="checked">checked</out:attribute></out:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates/>
- </input>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- =============================================== -->
- <!-- ================== Checkbox =================== -->
- <!-- =============================================== -->
- <!--
- <utml:input type="checkbox" name="fieldname" (value="fieldvalue") utml:update="true|false">
- <utml:read-only>....</utml:read-only>
- (<utml:value>....</utml:value>) - other place for value
- <utml:default-value>....</utml:default-value>
- </utml:input>
- Notes:
- -if the value of the checkbox isn't dynamic use the attribute and the code becomes smaller
- -->
- <xsl:template match="utml:input[(@type = 'checkbox')]" priority="1">
- <xsl:variable name="checkbox-prefix" select="'v-'"/>
- <out:variable name="{$checkbox-prefix}checked-value">
- <xsl:choose>
- <xsl:when test="@utml:update='false'">
- <xsl:copy-of select="utml:default-value/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <out:choose>
- <out:when test="key('utml-key-params', '{@name}')"><out:value-of select="key('utml-key-params', '{@name}')"/></out:when>
- <out:otherwise><xsl:copy-of select="utml:default-value/child::node()"/></out:otherwise>
- </out:choose>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <!-- if it isn't readonly and the value is hardcoded don't add extra logic -->
- <xsl:choose>
- <xsl:when test="@value and not((utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only))">
- <input>
- <xsl:copy-of select="@*[(local-name() != 'checked') and namespace-uri() != $utml-namespace-uri]"/>
- <out:if test="'{@value}' = ${$checkbox-prefix}checked-value"><out:attribute name="checked">checked</out:attribute></out:if>
- <xsl:apply-templates/>
- </input>
- </xsl:when>
- <xsl:otherwise>
- <out:variable name="{$checkbox-prefix}value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:variable>
- <xsl:choose>
- <xsl:when test="(utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only)">
- <out:variable name="{$checkbox-prefix}read-only">
- <xsl:choose>
- <xsl:when test="(utml:read-only)">
- <xsl:copy-of select="utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:when test="(ancestor::*[name() = 'utml:group']/utml:read-only/child::node())">
- <xsl:copy-of select="ancestor::*[name() = 'utml:group']/utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="ancestor::*[name() = 'utml:form']/utml:read-only/child::node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:choose>
- <out:when test="${$checkbox-prefix}read-only = 'true'">
- <img>
- <out:attribute name="src">
- <out:value-of select="$image_root"/>icon_disabled_checkbox_<out:if test="${$checkbox-prefix}checked-value != ${$checkbox-prefix}value">un</out:if>checked.gif</out:attribute>
- </img>
- </out:when>
- <out:otherwise>
- <input>
- <xsl:copy-of select="@*[(local-name() != 'value') and (local-name() != 'checked') and namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="value">
- <xsl:choose>
- <xsl:when test="@utml:update='false'">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-input-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </out:attribute>
- <out:if test="${$checkbox-prefix}checked-value = ${$checkbox-prefix}value"><out:attribute name="checked">checked</out:attribute></out:if>
- <xsl:apply-templates/>
- </input>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:otherwise>
- <input>
- <xsl:copy-of select="@*[(local-name() != 'value') and (local-name() != 'checked') and namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="value">
- <xsl:choose>
- <xsl:when test="@utml:update='false'">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="utml-input-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </out:attribute>
- <out:if test="string(${$checkbox-prefix}value) = ${$checkbox-prefix}checked-value"><out:attribute name="checked">checked</out:attribute></out:if>
- <xsl:apply-templates/>
- </input>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ================================================ -->
- <!-- ===================== Select =================== -->
- <!-- ================================================ -->
- <!--
- <utml:select name="fieldname">
- <utml:read-only>....</utml:read-only>
- <utml:default-value>....</utml:default-value>
- ...
- </utml:select>
- Notes:
- -the variables created for this will use the name as a prefix
- -default-value allows you to specify the default selected value
- -->
- <xsl:template match="utml:select" priority="1">
- <xsl:variable name="group-prefix" select="'v'"/>
- <out:variable name="{$group-prefix}read-only">
- <xsl:choose>
- <xsl:when test="(utml:read-only)">
- <xsl:copy-of select="utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:when test="(ancestor::*[name() = 'utml:group']/utml:read-only/child::node())">
- <xsl:copy-of select="ancestor::*[name() = 'utml:group']/utml:read-only/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="ancestor::*[name() = 'utml:form']/utml:read-only/child::node()"/>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:variable name="{$group-prefix}selected-value">
- <out:choose>
- <out:when test="key('utml-key-params', '{@name}')"><out:value-of select="key('utml-key-params', '{@name}')"/></out:when>
- <out:otherwise><xsl:copy-of select="utml:default-value/child::node()"/></out:otherwise>
- </out:choose>
- </out:variable>
- <xsl:choose>
- <xsl:when test="(utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only)">
- <out:choose>
- <out:when test="${$group-prefix}read-only = 'true'">
- <xsl:apply-templates/>
- </out:when>
- <out:otherwise>
- <select>
- <xsl:copy-of select="@*[(local-name() != 'default-value') and (local-name() != 'readonly') and namespace-uri() != $utml-namespace-uri]"/>
- <xsl:apply-templates/>
- </select>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:otherwise>
- <select>
- <xsl:copy-of select="@*[(local-name() != 'default-value') and (local-name() != 'readonly') and namespace-uri() != $utml-namespace-uri]"/>
- <xsl:apply-templates/>
- </select>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ================================================ -->
- <!-- ===================== Option =================== -->
- <!-- ================================================ -->
- <!--
- <utml:option (value="fieldvalue")>
- (<utml:value>....</utml:value>) - other place for value
- </utml:input>
- Notes:
- -if the value of the option isn't dynamic use the attribute and the code becomes smaller
- -->
- <xsl:template match="utml:option" priority="1">
- <xsl:variable name="group-prefix" select="'v'"/>
- <!-- this will try and streamline the code for when the value is hardcoded and not generated -->
- <xsl:choose>
- <xsl:when test="(ancestor::*[name() = 'utml:select']/utml:read-only) or (ancestor::*[name() = 'utml:form']/utml:read-only) or (ancestor::*[name() = 'utml:group']/utml:read-only)">
- <out:choose>
- <out:when test="${$group-prefix}read-only = 'true'">
- <xsl:choose>
- <xsl:when test="@value">
- <out:if test="'{@value}' = ${$group-prefix}selected-value">
- <xsl:apply-templates/>
- </out:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="option-prefix">
- <xsl:value-of select="concat($group-prefix, position())"/>
- </xsl:variable>
- <out:variable name="{$option-prefix}value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:variable>
- <out:if test="{$option-prefix}value = ${$group-prefix}selected-value">
- <xsl:apply-templates/>
- </out:if>
- </xsl:otherwise>
- </xsl:choose>
- </out:when>
- <out:otherwise>
- <xsl:choose>
- <xsl:when test="@value">
- <option>
- <xsl:copy-of select="@*[(local-name() != 'selected') and namespace-uri() != $utml-namespace-uri]"/>
- <out:if test="'{@value}' = ${$group-prefix}selected-value"><out:attribute name="selected">true</out:attribute></out:if>
- <xsl:apply-templates/>
- </option>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="option-prefix">
- <xsl:value-of select="concat($group-prefix, position())"/>
- </xsl:variable>
- <out:variable name="{$option-prefix}value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:variable>
- <option>
- <xsl:copy-of select="@*[(local-name() != 'selected') and (local-name() != 'value') and namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="value"><out:value-of select="{$option-prefix}value"/></out:attribute>
- <out:if test="${$option-prefix}value = ${$group-prefix}selected-value"><out:attribute name="selected">true</out:attribute></out:if>
- <xsl:apply-templates/>
- </option>
- </xsl:otherwise>
- </xsl:choose>
- </out:otherwise>
- </out:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@value">
- <option>
- <xsl:copy-of select="@*[(local-name() != 'selected') and namespace-uri() != $utml-namespace-uri]"/>
- <out:if test="'{@value}' = ${$group-prefix}selected-value"><out:attribute name="selected">true</out:attribute></out:if>
- <xsl:apply-templates/>
- </option>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="option-prefix">
- <xsl:value-of select="concat($group-prefix, position())"/>
- </xsl:variable>
- <out:variable name="{$option-prefix}value">
- <xsl:call-template name="utml-get-value">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </out:variable>
- <option>
- <xsl:copy-of select="@*[(local-name() != 'selected') and (local-name() != 'value') and namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="value"><out:value-of select="${$option-prefix}value"/></out:attribute>
- <out:if test="${$option-prefix}value = ${$group-prefix}selected-value"><out:attribute name="selected">true</out:attribute></out:if>
- <xsl:apply-templates/>
- </option>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ================================================ -->
- <!-- ===================== A:HREF =================== -->
- <!-- ================================================ -->
- <!--
- <utml:a (href="javascriptfunction") (utml:op="operation") *utml:formName="pform"> * - not needed when in a utml:form
- (<utml:href>....</utml:href>) - other place for href
- (<utml:op>....</utml:op>) - other place for operation
- </utml:input>
- Notes:
- -default operation is maintain
- -if you aren't directly inside a form use utml:formName to define the name - if you are it isn't needed
- -the href has to be a valid javascript call with ; at the end
- -->
- <xsl:template match="utml:a" priority="1">
- <!-- get the target -->
- <xsl:variable name="utml-target">
- <xsl:choose>
- <xsl:when test="@utml:target"><xsl:value-of select="@utml:target"/></xsl:when>
- <xsl:when test="utml:target"><xsl:copy-of select="utml:target/child::node()"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- get the validate -->
- <xsl:variable name="utml-validate">
- <xsl:choose>
- <xsl:when test="@utml:validate"><xsl:value-of select="@utml:validate"/></xsl:when>
- <xsl:when test="utml:validate"><xsl:copy-of select="utml:validate/child::node()"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- get the href -->
- <xsl:variable name="utml-href">
- <xsl:choose>
- <xsl:when test="@utml:href"><xsl:value-of select="@utml:href"/></xsl:when>
- <xsl:when test="utml:href"><xsl:copy-of select="utml:href/child::node()"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- get the name of the parent form, necessary for setting form variables via JS -->
- <xsl:variable name="parent-form-name">
- <xsl:choose>
- <xsl:when test="@utml:formName">
- <xsl:value-of select="@utml:formName"/>
- </xsl:when>
- <xsl:when test="ancestor::utml:form">
- <xsl:value-of select="ancestor::utml:form/@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">UTML ERROR: can't find the embedded form name.</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Output the HTML anchor -->
- <a>
- <!-- copy all non-utml attributes... -->
- <xsl:copy-of select="@*[namespace-uri() != $utml-namespace-uri]"/>
- <out:attribute name="href">
- <out:text>javascript:</out:text><xsl:copy-of select="$utml-href"/><xsl:call-template name="utml-gen-form-submit">
- <xsl:with-param name="formName" select="$parent-form-name"/>
- <xsl:with-param name="target" select="$utml-target"/>
- <xsl:with-param name="operation" select="@utml:op"/>
- <xsl:with-param name="validate" select="'false'"/>
- <xsl:with-param name="mode" select="'wsrp:edit'"/>
- </xsl:call-template>
- </out:attribute>
- <!--copy all non-utml child elements... -->
- <xsl:apply-templates/>
- </a>
- </xsl:template>
- <xsl:template match="utml:group" priority="1">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="utml:variables" priority="1">
- <out:key name="utml-key-params" match="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/wsrp:getMarkup/wsrp:markupParams/wsrp:navigationalState/param" use="@name"/>
- <out:variable name="utml-params" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/wsrp:getMarkup/wsrp:markupParams/wsrp:navigationalState/param"/>
- <out:variable name="utml-image-root" select="/root/bad_xpath_fix_me/resourceTemplate"/>
- <out:variable name="utml-mode" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/wsrp:getMarkup/wsrp:markupParams/wsrp:mode"/>
- </xsl:template>
- <!-- the main engine -->
- <xsl:template match="*[namespace-uri() = $utml-namespace-uri]" priority="0"/>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*[namespace-uri() != $utml-namespace-uri]"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|