123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2008
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Transform that takes markup and produces an HTML page
-
- The input to the transform should be the following
-
- <root>
- <morphletResponse>
- <markup>Markup to be displayed</markup>
- <browserTitle>Title for the browser</browserTitle>
- <request_stack_0>stack information that will get added as hidden inputs</request_stack_0>
- ...
- <request_stack_x>stack information</request_stack_x>
- </morphletResponse>
- <env>
- ...
- </env>
- <system>
- ...
- </system>
- <http>
- ...
- </http>
- </root>
- -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:key name="system-param" match="/*[local-name()='root']/system/param" use="@name"/>
- <xsl:key name="env-param" match="/*[local-name()='root']/env/param" use="@name"/>
- <xsl:key name="user-param" match="/*[local-name()='root']/user/param" use="@name"/>
- <xsl:template match="/*[local-name()='root']/*[local-name()='morphletResponse']/*[local-name()='markup']" priority="1">
- <xsl:variable name="webRoot">
- <xsl:choose>
- <!-- if we have a root then use it (may be empty if the root document directory has been setup in the web browser. See 573783)-->
- <xsl:when test="/root/http/param[@name='WEB_CONTENT_ROOT']">
- <xsl:value-of select="string(/root/http/param[@name='WEB_CONTENT_ROOT'])"/>
- </xsl:when>
- <!-- No official config param is present. Make this relative. -->
- <xsl:otherwise>..</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="app" select="key('system-param', 'app')"/>
- <xsl:variable name="gateway" select="string(/root/http/param[@name='SCRIPT_NAME'])"/>
- <xsl:variable name="user_skin">
- <xsl:choose>
- <xsl:when test="key('user-param', 'skin') != ''">
- <xsl:value-of select="key('user-param', 'skin')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('system-param', 'defaultPortalPreferences')/pref[@name='skin']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="skin_root" select="concat($webRoot, '/skins', '/', $user_skin)"/>
- <xsl:variable name="skin_style" select="concat($skin_root, '/', $app, '/default.css')"/>
- <xsl:variable name="skin_fonts" select="concat($skin_root, '/fonts.css')"/>
- <!-- produce the HTML to be displayed -->
- <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
- <html>
- <head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <meta name="copyright">
- <xsl:attribute name="content"><xts:string id="IDS_COPYRIGHT"/></xsl:attribute>
- </meta>
- <meta name="trademark">
- <xsl:attribute name="content"><xts:string id="IDS_TRADEMARK"/></xsl:attribute>
- </meta>
- <meta name="template">
- <xsl:attribute name="content"><xsl:value-of select="key('env-param', 'm')"/></xsl:attribute>
- </meta>
- <meta http-equiv="Expires" content="0"/>
-
- <title>
- <xsl:value-of select="../*[local-name()='browserTitle']"/>
- </title>
- <link rel="stylesheet" type="text/css">
- <xsl:attribute name="href">
- <xsl:value-of select="$skin_style"/>
- </xsl:attribute>
- </link>
- <link rel="stylesheet" type="text/css" href="{$skin_fonts}"/>
- <xsl:copy-of select="/*[local-name()='root']/*[local-name()='scripts']/*"/>
- </head>
- <body onload="if (window.init) init();" class="dialogBody">
- <xsl:attribute name="topmargin">3</xsl:attribute>
- <xsl:attribute name="bottommargin">0</xsl:attribute>
- <xsl:attribute name="marginheight">3</xsl:attribute>
- <xsl:attribute name="rightmargin">0</xsl:attribute>
- <xsl:attribute name="leftmargin">3</xsl:attribute>
- <xsl:attribute name="marginwidth">3</xsl:attribute>
- <form name="pform" method="post" action="{$gateway}">
- <xsl:apply-templates select="*" mode="copy"/>
- <xsl:copy-of select="/*[local-name()='root']/*[local-name()='formFields']/*"/>
- </form>
-
- <xsl:if test="../*[local-name()='debugDump']">
- <xsl:copy-of select="../*[local-name()='debugDump']"/>
- </xsl:if>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="@*|node()[local-name() != 'form']" mode="copy">
- <xsl:copy>
- <xsl:apply-templates select="@*" mode="copy"/>
- <xsl:apply-templates mode="copy"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="text()" priority="0"/>
- </xsl:stylesheet>
|