123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- +=========================================================================+
- | Licensed Materials - Property of IBM |
- | BI and PM: viewer |
- | (C) Copyright IBM Corp. 2002, 2010 |
- | |
- | US Government Users Restricted Rights - Use, duplication or |
- | disclosure restricted by GSA ADP Schedule Contract with IBM Corp. |
- | |
- +=========================================================================+
- -->
- <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
- <output method="text" encoding="UTF-8"/>
- <template match="/">
- <text>/*
</text>
- <text> *+------------------------------------------------------------------------+
</text>
- <text> *| Licensed Materials - Property of IBM
</text>
- <text> *| IBM Cognos Products: Viewer
</text>
- <text> *| (C) Copyright IBM Corp. 2013
</text>
- <text> *|
</text>
- <text> *| US Government Users Restricted Rights - Use, duplication or
</text>
- <text> *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
</text>
- <text> *|
</text>
- <text> *+------------------------------------------------------------------------+
</text>
- <text> */
</text>
- <for-each select="stringTable/component">
- <variable name="comp_name" select="@name"/>
- <variable name="comp_name_res">
- <value-of select="$comp_name"/>_RES</variable>
- <text>if (!</text>
- <value-of select="$comp_name_res"/>
- <text>) {
</text>
- <text>var </text>
- <value-of select="$comp_name_res"/>
- <text> = {};
</text>
- <text>}
</text>
- <for-each select="section[@name='JS']">
- <variable name="sect_name" select="@name"/>
- <if test="$sect_name != 'STC' and $sect_name != 'DFP' and $sect_name != 'CON'">
- <for-each select="string">
- <!-- Generate the name of the member COMPONENT_NAME_RES.ID, RV_RES.ids....-->
- <value-of select="$comp_name_res"/>
- <text>.</text>
- <value-of select="@id"/>
- <text> = "</text>
- <!-- generate the message text based on rule #3 and #4 -->
- <variable name="msgstring">
- <for-each select="child::node()">
- <choose>
- <when test="name() = 'param'">
- <choose>
- <when test="@name">
- <text disable-output-escaping="yes">{</text>
- <value-of select="@name"/>
- <text disable-output-escaping="yes">}</text>
- </when>
- <when test="@index">
- <text disable-output-escaping="yes">{</text>
- <value-of select="@index - 1"/>
- <text disable-output-escaping="yes">}</text>
- </when>
- <otherwise>
- <message terminate="yes">Parameter Substitution Error: Missing name or index.</message>
- </otherwise>
- </choose>
- </when>
- <when test="name() = ''">
- <value-of select="."/>
- </when>
- <otherwise>
- <copy>
- <copy-of select="@*"/>
- </copy>
- </otherwise>
- </choose>
- </for-each>
- </variable>
- <choose>
- <when test="@whiteSpace and @whiteSpace='preserve'">
- <text disable-output-escaping="yes">\</text>
- <value-of select="$msgstring"/>
- </when>
- <otherwise>
- <call-template name="escapeDoubleQuotes">
- <with-param name="string"><value-of select="normalize-space($msgstring)"/></with-param>
- </call-template>
- <!-- value-of select="normalize-space($msgstring)"/ -->
- </otherwise>
- </choose>
- <text>";
</text>
- </for-each>
- </if>
- </for-each>
- </for-each>
- </template>
- <template name="replaceChar">
- <param name="text"/>
- <param name="toReplace"/>
- <param name="replaceWith"/>
- <choose>
- <when test="contains($text, $toReplace)">
- <variable name="beforeChar" select="substring-before($text,$toReplace)"/>
- <variable name="afterChar">
- <call-template name="replaceChar">
- <with-param name="text" select="substring-after($text,$toReplace)"/>
- <with-param name="toReplace" select="$toReplace"/>
- <with-param name="replaceWith" select="$replaceWith"/>
- </call-template>
- </variable>
- <value-of select="concat($beforeChar, $replaceWith, $afterChar)"/>
- </when>
- <otherwise>
- <value-of select="$text"/>
- </otherwise>
- </choose>
- </template>
- <!-- copy everything by default -->
- <template name="copyAll" match="*">
- <copy>
- <copy-of select="@*"/>
- <apply-templates/>
- </copy>
- </template>
- <template name="escapeDoubleQuotes">
- <param name="string" select="''"/>
- <choose>
- <when test="contains($string, '"')">
- <text/>
- <value-of select="substring-before($string, '"')"/>\"<call-template name="escapeDoubleQuotes">
- <with-param name="string" select="substring-after($string, '"')"/>
- </call-template>
- <text/>
- </when>
- <otherwise>
- <text/>
- <value-of select="$string"/>
- <text/>
- </otherwise>
- </choose>
- </template>
-
- </stylesheet>
|