123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
- <!-- formlogic_init =============================================================================================== -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
- <xts:block id="postURL" type="exec" mode="output" processor="XSLT" dependency="formlogic_init" mimeType="text/html" contentId="head" partId="1" condition=".[/root/env/param[@name='doPostURL'] and /root/env/param[@name='doPostURL']!='']" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl xtsext xos xts xsd xsi">
- <xsl:output method="html" encoding="utf-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xsl:variable name="paramName" select="key('env-param','doPostURL')"/>
- <xsl:variable name="xurl" select="string(key('env-param', $paramName))"/>
- <xsl:variable name="action">
- <xsl:choose>
- <xsl:when test="contains($xurl, '?')"><xsl:value-of select="substring-before($xurl, '?')"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$xurl"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="arguments" select="substring-after($xurl, '?')"/>
- <html>
- <head>
- <script language="javascript">
- function submitForm()
- {
- <xsl:choose>
- <xsl:when test="($xurl = 'javascript:window.close();') or ($action='' and $arguments='')">
- window.close();
- </xsl:when>
- <xsl:otherwise>
- document.pform.submit();
- </xsl:otherwise>
- </xsl:choose>
- }
- </script>
- </head>
- <body onload="submitForm();">
- <form name="pform" method="post">
- <xsl:attribute name="action"><xsl:value-of select="$action"/></xsl:attribute>
- <xsl:call-template name="buildForm">
- <xsl:with-param name="arguments">
- <xsl:value-of select="$arguments"/>
- </xsl:with-param>
- </xsl:call-template>
- </form>
- </body>
- </html>
- </xsl:template>
- <xsl:template name="buildForm">
- <xsl:param name="arguments" select="''"/>
- <input type="hidden">
- <xsl:variable name="name">
- <xsl:value-of select="string(xtsext:urldecode(substring-before($arguments, '=')))"/>
- </xsl:variable>
- <xsl:variable name="argumentsLessName">
- <xsl:value-of select="substring-after($arguments, '=')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($argumentsLessName, '&')">
- <xsl:variable name="value">
- <xsl:value-of select="string(xtsext:urldecode(substring-before($argumentsLessName, '&')))"/>
- </xsl:variable>
- <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of select="$value"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="value">
- <xsl:value-of select="string(xtsext:urldecode(string($argumentsLessName)))"/>
- </xsl:variable>
- <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of select="$value"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </input>
- <xsl:variable name="argumentsStripped">
- <xsl:value-of select="substring-after($arguments, '&')"/>
- </xsl:variable>
- <xsl:if test="contains($arguments, '&')">
- <xsl:call-template name="buildForm">
- <xsl:with-param name="arguments">
- <xsl:value-of select="$argumentsStripped"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug
- ===============================================================================================
- -->
- <xts:block id="debug" dependency="postURL" condition=".[ /root/session/param[@name='debug'] = '1' ]" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|