<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet
[<!--  UTF-8 encoded list of entitites  --><!--  cps-identification: do not change next line  --><!ENTITY AAA-cps-entities 'AAA-cps-entities'>
<!ENTITY excl '&#33;'>
<!ENTITY quot '&#34;'>
<!ENTITY num '&#35;'>
<!ENTITY dollar '&#36;'>
<!ENTITY percnt '&#37;'>
<!ENTITY amp '&#38;#38;'>
<!ENTITY apos '&#39;'>
<!ENTITY lpar '&#40;'>
<!ENTITY rpar '&#41;'>
<!ENTITY ast '&#42;'>
<!ENTITY plus '&#43;'>
<!ENTITY comma '&#44;'>
<!ENTITY hyphen '&#45;'>
<!ENTITY period '&#46;'>
<!ENTITY sol '&#47;'>
<!ENTITY colon '&#58;'>
<!ENTITY semi '&#59;'>
<!ENTITY lt '&#38;#60;'>
<!ENTITY equals '&#61;'>
<!ENTITY gt '&#62;'>
<!ENTITY quest '&#63;'>
<!ENTITY nbsp '&#160;'>
<!ENTITY iexcl '&#161;'>
<!ENTITY cent '&#162;'>
<!ENTITY pound '&#163;'>
<!ENTITY curren '&#164;'>
<!ENTITY yen '&#165;'>
<!ENTITY brvbar '&#166;'>
<!ENTITY sect '&#167;'>
<!ENTITY uml '&#168;'>
<!ENTITY copy '&#169;'>
<!ENTITY ordf '&#170;'>
<!ENTITY laquo '&#171;'>
<!ENTITY not '&#172;'>
<!ENTITY shy '&#173;'>
<!ENTITY reg '&#174;'>
<!ENTITY macr '&#175;'>
<!ENTITY deg '&#176;'>
<!ENTITY plusmn '&#177;'>
<!ENTITY sup2 '&#178;'>
<!ENTITY sup3 '&#179;'>
<!ENTITY acute '&#180;'>
<!ENTITY micro '&#181;'>
<!ENTITY para '&#182;'>
<!ENTITY middot '&#183;'>
<!ENTITY cedil '&#184;'>
<!ENTITY sup1 '&#185;'>
<!ENTITY ordm '&#186;'>
<!ENTITY raquo '&#187;'>
<!ENTITY frac14 '&#188;'>
<!ENTITY frac12 '&#189;'>
<!ENTITY frac34 '&#190;'>
<!ENTITY iquest '&#191;'>
<!ENTITY Agrave '&#192;'>
<!ENTITY Aacute '&#193;'>
<!ENTITY Acirc '&#194;'>
<!ENTITY Atilde '&#195;'>
<!ENTITY Auml '&#196;'>
<!ENTITY Aring '&#197;'>
<!ENTITY AElig '&#198;'>
<!ENTITY Ccedil '&#199;'>
<!ENTITY Egrave '&#200;'>
<!ENTITY Eacute '&#201;'>
<!ENTITY Ecirc '&#202;'>
<!ENTITY Euml '&#203;'>
<!ENTITY Igrave '&#204;'>
<!ENTITY Iacute '&#205;'>
<!ENTITY Icirc '&#206;'>
<!ENTITY Iuml '&#207;'>
<!ENTITY ETH '&#208;'>
<!ENTITY Ntilde '&#209;'>
<!ENTITY Ograve '&#210;'>
<!ENTITY Oacute '&#211;'>
<!ENTITY Ocirc '&#212;'>
<!ENTITY Otilde '&#213;'>
<!ENTITY Ouml '&#214;'>
<!ENTITY times '&#215;'>
<!ENTITY Oslash '&#216;'>
<!ENTITY Ugrave '&#217;'>
<!ENTITY Uacute '&#218;'>
<!ENTITY Ucirc '&#219;'>
<!ENTITY Uuml '&#220;'>
<!ENTITY Yacute '&#221;'>
<!ENTITY THORN '&#222;'>
<!ENTITY szlig '&#223;'>
<!ENTITY agrave '&#224;'>
<!ENTITY aacute '&#225;'>
<!ENTITY acirc '&#226;'>
<!ENTITY atilde '&#227;'>
<!ENTITY auml '&#228;'>
<!ENTITY aring '&#229;'>
<!ENTITY aelig '&#230;'>
<!ENTITY ccedil '&#231;'>
<!ENTITY egrave '&#232;'>
<!ENTITY eacute '&#233;'>
<!ENTITY ecirc '&#234;'>
<!ENTITY euml '&#235;'>
<!ENTITY igrave '&#236;'>
<!ENTITY iacute '&#237;'>
<!ENTITY icirc '&#238;'>
<!ENTITY iuml '&#239;'>
<!ENTITY eth '&#240;'>
<!ENTITY ntilde '&#241;'>
<!ENTITY ograve '&#242;'>
<!ENTITY oacute '&#243;'>
<!ENTITY ocirc '&#244;'>
<!ENTITY otilde '&#245;'>
<!ENTITY ouml '&#246;'>
<!ENTITY divide '&#247;'>
<!ENTITY oslash '&#248;'>
<!ENTITY ugrave '&#249;'>
<!ENTITY uacute '&#250;'>
<!ENTITY ucirc '&#251;'>
<!ENTITY uuml '&#252;'>
<!ENTITY yacute '&#253;'>
<!ENTITY thorn '&#254;'>
<!ENTITY yuml '&#255;'>
<!--  greek upper case letters  --><!ENTITY Alpha '&#913;'>
<!ENTITY Beta '&#914;'>
<!ENTITY Gamma '&#915;'>
<!ENTITY Delta '&#916;'>
<!ENTITY Epsilon '&#917;'>
<!ENTITY Zeta '&#918;'>
<!ENTITY Eta '&#919;'>
<!ENTITY Theta '&#920;'>
<!ENTITY Iota '&#921;'>
<!ENTITY Kappa '&#922;'>
<!ENTITY Lambda '&#923;'>
<!ENTITY Mu '&#924;'>
<!ENTITY Nu '&#925;'>
<!ENTITY Xi '&#926;'>
<!ENTITY Omicron '&#927;'>
<!ENTITY Pi '&#928;'>
<!ENTITY Rho '&#929;'>
<!ENTITY Sigma '&#931;'>
<!ENTITY Tau '&#932;'>
<!ENTITY Upsilon '&#933;'>
<!ENTITY Phi '&#934;'>
<!ENTITY Chi '&#935;'>
<!ENTITY Psi '&#936;'>
<!ENTITY Omega '&#937;'>
<!--  greek lowercase letters  --><!ENTITY alpha '&#945;'>
<!ENTITY beta '&#946;'>
<!ENTITY gamma '&#947;'>
<!ENTITY delta '&#948;'>
<!ENTITY epsilon '&#949;'>
<!ENTITY zeta '&#950;'>
<!ENTITY eta '&#951;'>
<!ENTITY theta '&#952;'>
<!ENTITY iota '&#953;'>
<!ENTITY kappa '&#954;'>
<!ENTITY lambda '&#955;'>
<!ENTITY mu '&#956;'>
<!ENTITY nu '&#957;'>
<!ENTITY xi '&#958;'>
<!ENTITY omicron '&#959;'>
<!ENTITY pi '&#960;'>
<!ENTITY rho '&#961;'>
<!ENTITY sigmaf '&#962;'>
<!ENTITY sigma '&#963;'>
<!ENTITY tau '&#964;'>
<!ENTITY upsilon '&#965;'>
<!ENTITY phi '&#966;'>
<!ENTITY chi '&#967;'>
<!ENTITY psi '&#968;'>
<!ENTITY omega '&#969;'>
<!ENTITY thetasym '&#977;'>
<!ENTITY upsih '&#978;'>
<!ENTITY piv '&#982;'>
<!--  letter-like characters   --><!ENTITY weierp '&#8472;'>
<!ENTITY image '&#8465;'>
<!ENTITY real '&#8476;'>
<!ENTITY trade '&#8482;'>
<!ENTITY alefsym '&#8501;'>
<!--  arrows  --><!ENTITY larr '&#8592;'>
<!ENTITY uarr '&#8593;'>
<!ENTITY rarr '&#8594;'>
<!ENTITY darr '&#8595;'>
<!ENTITY harr '&#8596;'>
<!ENTITY crarr '&#8629;'>
<!ENTITY lArr '&#8656;'>
<!ENTITY uArr '&#8657;'>
<!ENTITY rArr '&#8658;'>
<!ENTITY dArr '&#8659;'>
<!ENTITY hArr '&#8660;'>
<!--  mathematical operations  --><!ENTITY forall '&#8704;'>
<!ENTITY part '&#8706;'>
<!ENTITY exist '&#8707;'>
<!ENTITY empty '&#8709;'>
<!ENTITY nabla '&#8711;'>
<!ENTITY isin '&#8712;'>
<!ENTITY notin '&#8713;'>
<!ENTITY ni '&#8715;'>
<!ENTITY prod '&#8719;'>
<!ENTITY sum '&#8721;'>
<!ENTITY minus '&#8722;'>
<!ENTITY lowast '&#8727;'>
<!ENTITY radic '&#8730;'>
<!ENTITY prop '&#8733;'>
<!ENTITY infin '&#8734;'>
<!ENTITY ang '&#8736;'>
<!ENTITY and '&#8869;'>
<!ENTITY or '&#8870;'>
<!ENTITY cap '&#8745;'>
<!ENTITY cup '&#8746;'>
<!ENTITY int '&#8747;'>
<!ENTITY there4 '&#8756;'>
<!ENTITY sim '&#8764;'>
<!ENTITY cong '&#8773;'>
<!ENTITY asymp '&#8776;'>
<!ENTITY ne '&#8800;'>
<!ENTITY equiv '&#8801;'>
<!ENTITY le '&#8804;'>
<!ENTITY ge '&#8805;'>
<!ENTITY sub '&#8834;'>
<!ENTITY sup '&#8835;'>
<!ENTITY nsub '&#8836;'>
<!ENTITY sube '&#8838;'>
<!ENTITY supe '&#8839;'>
<!ENTITY oplus '&#8853;'>
<!ENTITY otimes '&#8855;'>
<!ENTITY perp '&#8869;'>
<!ENTITY sdot '&#8901;'>
<!--  technical symbols  --><!ENTITY lceil '&#8968;'>
<!ENTITY rceil '&#8969;'>
<!ENTITY lfloor '&#8970;'>
<!ENTITY rfloor '&#8971;'>
<!ENTITY lang '&#9001;'>
<!ENTITY rang '&#9002;'>
<!--  geometric symbols  --><!ENTITY loz '&#9674;'>
<!--  other symbols  --><!ENTITY spades '&#9824;'>
<!ENTITY clubs '&#9827;'>
<!ENTITY hearts '&#9829;'>
<!ENTITY diams '&#9830;'>
<!--  interpunctation characters  --><!ENTITY bull '&#8226;'>
<!ENTITY hellip '&#8230;'>
<!ENTITY prime '&#8242;'>
<!ENTITY oline '&#8254;'>
<!ENTITY frasl '&#8260;'>
<!ENTITY ensp '&#8194;'>
<!ENTITY emsp '&#8195;'>
<!ENTITY thinsp '&#8201;'>
<!ENTITY zwnj '&#8204;'>
<!ENTITY zwj '&#8205;'>
<!ENTITY lrm '&#8206;'>
<!ENTITY rlm '&#8207;'>
<!ENTITY ndash '&#8211;'>
<!ENTITY mdash '&#8212;'>
<!ENTITY lsquo '&#8216;'>
<!ENTITY rsquo '&#8217;'>
<!ENTITY sbquo '&#8218;'>
<!ENTITY ldquo '&#8220;'>
<!ENTITY rdquo '&#8221;'>
<!ENTITY bdquo '&#8222;'>
<!ENTITY dagger '&#8224;'>
<!ENTITY Dagger '&#8225;'>
<!ENTITY permil '&#8240;'>
<!ENTITY lsaquo '&#8249;'>
<!ENTITY rsaquo '&#8250;'>
<!--  currency symbols  --><!ENTITY euro '&#8364;'>
]>
<xsl:stylesheet exclude-result-prefixes=" fo xsl-template rdf rde-rdf rde-fdl rde-xmaps rde-idea rde-dm rde-rd" rde-rd:content="hs" rde-rd:datalanguage="en" rde-rd:leasingtime="600000" rde-rd:locale="en" rde-rd:project="smithnephewls" rde-rd:rdeContentType="1" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rde-dm="http://www.reddot.de/rde/ns/dm" xmlns:rde-fdl="http://www.reddot.de/rde/ns/fdl" xmlns:rde-idea="http://www.reddot.de/rde/ns/idea" xmlns:rde-rd="http://www.reddot.de/2000/rde/rd" xmlns:rde-rdf="http://www.reddot.de/rde/ns/rdf" xmlns:rde-xmaps="http://www.reddot.de/rde/ns/xmaps" xmlns:rdf="http://www.w3.org/TR/REC-rdf-syntax/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl-template="http://www.reddot.de/rde/ns/template"><xsl:param name="rdeRedDot" /><xsl:param name="rdeXmlID" /><xsl:param name="rdeXslID" /><xsl:param name="rdeProjectID" /><xsl:param name="rdeHttpServer" /><xsl:param name="rdeHttpsServer" /><xsl:param name="rdeSessionID" /><xsl:param name="rdeWeblet" /><xsl:param name="rdeContextRoot" /><xsl:param name="rdeAbsolutePrefix" /><xsl:param name="rdePrefix" /><xsl:output encoding="UTF-8" method="html" /><xsl:template match="rde-html"><xsl:apply-templates /></xsl:template><xsl:template match="rde-html-section"><xsl:value-of disable-output-escaping="yes" select="." /></xsl:template><!--
==========================================================================
  Stylesheet: search.xsl
     Company: RedDot Solutions
     Version: 0.5
      Author: Jack Marczewski [RedDot]
 Description: Display search results
      Notice: adv_search.asp
========================================================================== --><xsl:param name="keywords" /><xsl:param name="searchType" /><xsl:param name="sort" /><xsl:variable name="advanced-search-link" select="'adv_search.htm'" /><!--
==========================================================================
    Template: fulltext-search
    Description: Top-Level match. Applies only select child templates.
========================================================================== --><xsl:template match="fulltext-search"><!--<h1 class="pageHeading">Search Results</h1>--><xsl:apply-templates select="fulltext-search-results" /></xsl:template><!--
==========================================================================
    Template: fulltext-search-results
    Description: Displays verity search results comprising site search.
========================================================================== --><xsl:template match="fulltext-search-results"><!-- display search summary or search error --><xsl:choose><xsl:when test="@hits = 0 or not(@hits)"><!-- BEGIN M23 search error --><!-- END M23 search error --></xsl:when><xsl:otherwise><!-- BEGIN M22 search summary --><p class="paddingTop22">Your search for '<span class="keyword"><xsl:value-of select="$keywords" /></span>' returned <xsl:value-of select="@hits" /> results.</p><!-- END M22 search summary --></xsl:otherwise></xsl:choose><!-- BEGIN M15 search --><div class="search"><!--<form name="frm_searchFor" action="{$rdeXmlID}" method="GET">--><form action="" method="GET" name="frm_searchFor"><ul><li><strong>Search for:</strong></li><li><input id="keyword" name="keywords" style="width:350px;" type="text" value="{$keywords}" /></li><li><input class="button" id="btn_search" onclick="document.forms.frm_searchFor.submit()" type="button" value="Search" /></li></ul><!-- build hidden input fields with remaining values --><xsl:call-template name="build-form-fields"><xsl:with-param name="params" select="../search-params" /></xsl:call-template><a class="link_adv_search" href="{$advanced-search-link}">advanced search</a><!-- BEGIN M17 search sort --><div class="searchSort"><fieldset><ul><li class="first"><strong>Sort By:</strong></li><!--<li><input type="radio" value="score" id="relevance" class="radio" name="sort" /></li>--><li><xsl:element name="input"><xsl:attribute name="type">radio</xsl:attribute><xsl:attribute name="value">score</xsl:attribute><xsl:attribute name="id">relevance</xsl:attribute><xsl:attribute name="class">radio</xsl:attribute><xsl:attribute name="name">sort</xsl:attribute><xsl:if test="($sort != 'dateModified')"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></xsl:element></li><li><label for="relevance">Relevance</label></li><!--<li><input type="radio" value="dateModified" id="dateModified" class="radio" name="sort" /></li>--><li><xsl:element name="input"><xsl:attribute name="type">radio</xsl:attribute><xsl:attribute name="value">dateModified</xsl:attribute><xsl:attribute name="id">dateModified</xsl:attribute><xsl:attribute name="class">radio</xsl:attribute><xsl:attribute name="name">sort</xsl:attribute><xsl:if test="$sort = 'dateModified'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></xsl:element></li><li><label for="dateModified">Date Modified</label></li><li class="textRight"><input class="sort" id="sort" onclick="document.forms.frm_searchFor.submit()" type="button" value="sort" /></li></ul></fieldset></div><!-- END M17 search sort --></form></div><!-- END M15 search --><div class="clear paddingBottom10" /><xsl:choose><xsl:when test="@hits &gt; 0"><!-- BEGIN M18 search result --><div id="search_results"><ul><xsl:for-each select="content"><li class="search_listing"><div class="result_detail"><ul class="faq_answer"><xsl:variable name="search-link" select="concat(./name)" /><h4><a href="{$search-link}"><xsl:choose><xsl:when test="string-length(title)!=0"><xsl:value-of disable-output-escaping="yes" select="title" /></xsl:when><xsl:otherwise><xsl:value-of select="name" /></xsl:otherwise></xsl:choose></a></h4><li><p><xsl:call-template name="highlight"><xsl:with-param name="text" select="context" /><xsl:with-param name="keywords" select="$keywords" /><xsl:with-param name="class" select="'keyword'" /></xsl:call-template></p><p class="marginTop10 date"><!-- TODO: insert date (11 August 2006 -12:30) --><xsl:choose><xsl:when test="string-length(global.Modification_Date)!=0"><xsl:call-template name="format-date-time"><xsl:with-param name="datetime"><xsl:call-template name="format-verity-date-k2"><xsl:with-param name="verity-date" select="global.Modification_Date" /></xsl:call-template></xsl:with-param><xsl:with-param name="format-string" select="'dd mmmm yyyy -hh:mm'" /></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="format-date-time"><xsl:with-param name="datetime"><xsl:call-template name="format-verity-date-k2"><xsl:with-param name="verity-date" select="global.Creation_Date" /></xsl:call-template></xsl:with-param><xsl:with-param name="format-string" select="'dd mmmm yyyy -hh:mm'" /></xsl:call-template></xsl:otherwise></xsl:choose><span class="marginLeft30"><xsl:if test="type='BLOB'"><img alt="adobe icon" class="marginRight5" height="19" src="images/icn_pdf_small.gif" width="20" /><span class="keyword">PDF</span></xsl:if></span></p><xsl:if test="string-length(breadcrumbs)!=0"><xsl:value-of disable-output-escaping="yes" select="breadcrumbs" /></xsl:if></li></ul></div><div class="clear_left" /></li></xsl:for-each></ul></div><!-- END M18 search result --><div class="clear paddingBottom10" /><!-- BEGIN M19 pagination --><ul class="searchPagination"><xsl:variable name="pagination-links"><xsl:call-template name="pageableLinks"><xsl:with-param name="chunk" select="@chunk" /><xsl:with-param name="lastchunk" select="@lastchunk" /><xsl:with-param name="nextchunk" select="@nextchunk" /><xsl:with-param name="previouschunk" select="@previouschunk" /><xsl:with-param name="chunksize" select="@chunksize" /><xsl:with-param name="search-params" select="../search-params" /></xsl:call-template></xsl:variable><li><xsl:text>Page </xsl:text><span class="keyword"><xsl:value-of select="@chunk" /></span><xsl:text> of </xsl:text><span class="keyword"><xsl:value-of select="@lastchunk" /></span><xsl:if test="string-length($pagination-links)!=0"><xsl:text>:</xsl:text></xsl:if></li><xsl:copy-of select="$pagination-links" /></ul><!-- END M19 pagination --></xsl:when><xsl:otherwise><span> </span></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: build-form-fields
    Description: Build form hidden input fields from search parameters.
========================================================================== --><xsl:template name="build-form-fields"><xsl:param name="params" select="-1" /><xsl:if test="$params != -1"><xsl:for-each select="$params/node()"><xsl:choose><!-- check if there are any nested elements --><xsl:when test="count(child::node()) &gt; 1"><xsl:call-template name="build-form-fields"><xsl:with-param name="params" select="." /></xsl:call-template></xsl:when><xsl:otherwise><!-- if value is not blank, and node is not keywords --><xsl:if test="(string-length(.)!=0) and (name()!='keywords') and (name()!='sort')"><!-- output hidden input field --><input name="{name()}" type="hidden" value="{.}" /></xsl:if></xsl:otherwise></xsl:choose></xsl:for-each></xsl:if></xsl:template><!--
==========================================================================
    Template: build-search-breadcrumbs
    Description: !!!DEPRECATED!!! Build breadcrumbs from search results.
========================================================================== --><xsl:template name="build-search-breadcrumbs"><xsl:param name="string" select="-1" /><xsl:if test="$string != -1"><!-- get first list item: i.e. starts with "<li" and ends with "</li". --><!-- - Note: the reason what the start check isn't "<li>" is because of possible attributes: <li class="selected"> --><xsl:variable name="list-item1" select="concat(substring-before(substring-after($string, '&lt;li'),'/li&gt;'),'temp temp temp')" /><xsl:variable name="list-item2" select="substring-before(substring-after($list-item1, '&gt;'),'&lt;temp temp temp')" /><!-- get remaining string --><xsl:variable name="remain" select="substring-after($string, '/li&gt;')" /><!-- display list item --><li><xsl:call-template name="parse-tag-string"><xsl:with-param name="string" select="$list-item2" /></xsl:call-template><xsl:if test="contains($remain, '&lt;li')"><xsl:text> &gt;</xsl:text></xsl:if></li><!-- check remaining string for list items --><xsl:if test="contains($remain, '&lt;li')"><xsl:call-template name="build-search-breadcrumbs"><xsl:with-param name="string" select="$remain" /></xsl:call-template></xsl:if></xsl:if></xsl:template><!--
==========================================================================
    Template: parse-tag-string
    Description: !!!DEPRECATED!!! Parse out text from within tag strings.
                 Ex: "text" from "<b>text</b>"
    
========================================================================== --><xsl:template name="parse-tag-string"><xsl:param name="string" select="-1" /><xsl:if test="$string != -1"><!-- check if the string contains tag elements --><xsl:choose><xsl:when test="contains($string,'&gt;') and contains($string,'&lt;/')"><!-- get string after '>' --><xsl:variable name="string1" select="substring-after($string, '&gt;')" /><!-- get string before '</', from the end of the string --><xsl:variable name="string2"><xsl:call-template name="substring-before-end"><xsl:with-param name="text" select="$string1" /><xsl:with-param name="string" select="'&lt;/'" /></xsl:call-template></xsl:variable><!-- parse remaining text (recursive) --><xsl:call-template name="parse-tag-string"><xsl:with-param name="string" select="$string2" /></xsl:call-template></xsl:when><xsl:otherwise><!-- return string --><xsl:value-of disable-output-escaping="yes" select="$string" /></xsl:otherwise></xsl:choose></xsl:if></xsl:template><!--
==========================================================================
    Template: substring-before-end
 Description: Return substring of text before the specified string, from
              the end of the text.
  Parameters:
    <text> - text to check for string
    <string> - string to be checked for in text
========================================================================== --><xsl:template name="substring-before-end"><xsl:param name="text" select="-1" /><xsl:param name="string" /><xsl:if test="($text != -1) and (contains($text,$string))"><xsl:value-of select="substring-before($text,$string)" /><xsl:variable name="next" select="substring-after($text, $string)" /><xsl:if test="contains($next,$string)"><xsl:value-of select="$string" /><xsl:call-template name="substring-before-end"><xsl:with-param name="text" select="$next" /><xsl:with-param name="string" select="$string" /></xsl:call-template></xsl:if></xsl:if></xsl:template><!--
==========================================================================
  Stylesheet: pagination.xsl
     Company: RedDot Solutions
     Version: 0.6.5 (2007.08.28)
      Author: Jack Marczewski [RedDot]
 Description: Display pagination links
      Notice: 
========================================================================== --><!--
==========================================================================
    Template: pageableLinks
    Description: Displays pageable links.
========================================================================== --><xsl:template name="pageableLinks"><xsl:param name="chunk" /><xsl:param name="lastchunk" /><xsl:param name="nextchunk" /><xsl:param name="previouschunk" /><xsl:param name="chunksize" /><xsl:param name="hits" /><xsl:param name="search-params" /><xsl:param name="show-pagenumbers" select="'true'" /><xsl:param name="show-viewall" select="'true'" /><!-- generate search parameters URL --><xsl:variable name="s-parameters"><xsl:call-template name="buildSearchParams"><xsl:with-param name="params" select="$search-params" /></xsl:call-template></xsl:variable><!-- set link URL --><!--<xsl:variable name="returnURL" select="concat($rdeXmlID, $s-parameters)" />--><xsl:variable name="returnURL" select="concat('', $s-parameters)" /><!-- previous link --><xsl:if test="$previouschunk!=''"><xsl:variable name="prevUrl" select="concat($returnURL, '&amp;chunk=', $previouschunk)" /><li><!-- 14Jan,2008, Remedy#INC00000062086, internationalization --><a class="pagination" href="{$prevUrl}" id="paginationPriviousLinkText">&lt;&lt; Previous</a></li></xsl:if><!-- page numbers --><xsl:if test="($show-pagenumbers = 'true') and ($lastchunk &gt; 1)"><xsl:call-template name="pagenumbers"><xsl:with-param name="count" select="$lastchunk" /><xsl:with-param name="lastindex" select="$lastchunk" /><xsl:with-param name="startindex" select="$chunk - 6" /><xsl:with-param name="currentpage" select="$chunk" /><xsl:with-param name="endindex" select="$chunk + 6" /><xsl:with-param name="pageurl" select="$returnURL" /></xsl:call-template></xsl:if><!-- next link --><xsl:if test="$nextchunk!=''"><xsl:variable name="nextUrl" select="concat($returnURL, '&amp;chunk=', $nextchunk)" /><li><!-- 14Jan,2008, Remedy#INC00000062086, internationalization --><a class="pagination" href="{$nextUrl}" id="paginationNextLinkText">Next &gt;&gt;</a></li></xsl:if><!-- view all link --><xsl:if test="($show-viewall = 'true') and ($lastchunk &gt; 1)"><xsl:variable name="all"><xsl:choose><xsl:when test="string-length($hits)!=0"><xsl:value-of select="$hits" /></xsl:when><xsl:when test="(string-length($chunksize)!=0) and (string-length($lastchunk)!=0)"><xsl:value-of select="$chunksize * $lastchunk" /></xsl:when><xsl:otherwise>1000</xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="viewAllUrl" select="concat($returnURL, '&amp;chunksize=', $all)" /><li><!-- 14Jan,2008, Remedy#INC00000062086, internationalization --><a class="pagination" href="{$viewAllUrl}" id="paginationViewAllLinkText">View All</a></li></xsl:if></xsl:template><!--
==========================================================================
    Template: pagenumbers
    Description: Displays page number links.
========================================================================== --><xsl:template name="pagenumbers"><xsl:param name="startindex" select="1" /><xsl:param name="count" select="1" /><xsl:param name="currentpage" select="1" /><xsl:param name="endindex" select="1" /><xsl:param name="lastindex" select="1" /><xsl:param name="pageurl" select="1" /><!-- determine start number --><xsl:variable name="index"><xsl:choose><xsl:when test="$startindex &lt;= 0">1</xsl:when><xsl:otherwise><xsl:value-of select="$startindex" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:if test="($count &gt; 0) and ($index &lt;= $endindex) and ($index &lt;= $lastindex)"><xsl:choose><xsl:when test="$index = $currentpage"><li class="selected"><xsl:value-of select="$index" /></li></xsl:when><xsl:otherwise><li><xsl:element name="a"><xsl:attribute name="class">pagination</xsl:attribute><xsl:attribute name="href"><xsl:value-of select="$pageurl" />&amp;chunk=<xsl:value-of select="$index" /></xsl:attribute><xsl:value-of select="$index" /></xsl:element></li></xsl:otherwise></xsl:choose><xsl:call-template name="pagenumbers"><xsl:with-param name="startindex" select="$index + 1" /><xsl:with-param name="lastindex" select="$lastindex" /><xsl:with-param name="count" select="$count - 1" /><xsl:with-param name="currentpage" select="$currentpage" /><xsl:with-param name="pageurl" select="$pageurl" /><xsl:with-param name="endindex" select="$endindex" /></xsl:call-template></xsl:if></xsl:template><!--
==========================================================================
    Template: buildSearchParams
 Description: Creates a string of search parameters to be used with
              pagination (ex. "?x=1&y=2&z=3"), based on an XML structure 
              of parameters. The XML elements of this structure should be
              named after the parameter, and the values contained within
              the elements. For multi-valued parameters (ex. "?z=3&z=4"),
              each value be contained within an element of the same name.
                Example of XML structure:
                  <search-params>
                    <x>1</x>
                    <y>2</y>
                    <z>3</z>
                    <z>4</z>
                  </search-params>
  Parameters:
    <init-pos> <params> <exclude>
========================================================================== --><xsl:template name="buildSearchParams"><xsl:param name="count" select="1" /><xsl:param name="pre" select="''" /><xsl:param name="params" /><xsl:param name="exclude" /><xsl:param name="total" select="count($params/node())" /><!-- start search url --><xsl:if test="$count = 1"><xsl:text>?</xsl:text></xsl:if><!-- if params exist --><xsl:if test="($total &gt; 0) and ($count &lt;= $total)"><xsl:for-each select="$params/node()[position() = $count]"><!-- check excludes --><xsl:variable name="excludeNode"><xsl:if test="contains($exclude, concat('|',name(),'|'))">true</xsl:if></xsl:variable><!-- check node --><xsl:choose><xsl:when test="(string-length(text())!=0) and ($excludeNode != 'true')"><xsl:value-of select="$pre" /><xsl:value-of select="name()" /><xsl:text>=</xsl:text><xsl:value-of select="text()" /><!-- check next node - recursive --><xsl:call-template name="buildSearchParams"><xsl:with-param name="params" select="$params" /><xsl:with-param name="count" select="$count + 1" /><xsl:with-param name="exclude" select="$exclude" /><xsl:with-param name="total" select="$total" /><xsl:with-param name="pre" select="'&amp;'" /></xsl:call-template></xsl:when><xsl:otherwise><!-- check next node - recursive --><xsl:call-template name="buildSearchParams"><xsl:with-param name="params" select="$params" /><xsl:with-param name="count" select="$count + 1" /><xsl:with-param name="exclude" select="$exclude" /><xsl:with-param name="total" select="$total" /><xsl:with-param name="pre" select="$pre" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:for-each></xsl:if></xsl:template><!--
==========================================================================
  Stylesheet: highlight.xsl
     Version: 1.0.8
      Author: Jack Marczewski [RedDot] -  June 18, 2007
     Updated: Jack Marczewski [RedDot] -  August 08, 2007
 Description: This stylesheet is intended to highlight all search text in
              Verity context results. It also outputs the context so that
              special characters are properly displayed.
========================================================================== --><!--
==========================================================================
    Template: highlight
 Description: highlight keywords that are found within the associated
              text.
  Parameters:
    <text> - block of text that contains words to be highlighted
    <keywords> - words that should be highlighted in text (separated by space)
    <sep> - (Optional) separator in text for tokenizing (default: space)
    <style> - (Optional) CSS style used for highlighted words
    <class> - (Optional) class attribute used for highlighted words. Takes
              precedence over the <style> parameter if specified
========================================================================== --><xsl:template name="highlight"><xsl:param name="text" select="''" /><xsl:param name="keywords" select="''" /><xsl:param name="sep" select="' '" /><xsl:param name="style" select="'color:red;'" /><xsl:param name="class" select="''" /><!-- pad text --><xsl:variable name="text1" select="concat($text, $sep)" /><!-- get token --><xsl:variable name="token" select="substring-before($text1, $sep)" /><!-- TODO: trim token? shouldn't be necessary if separator is a space --><xsl:variable name="tokenCheck" select="$token" /><!-- TODO: trim keywords? shouldn't be necessary if separator is a space --><xsl:variable name="keywordsCheck" select="$keywords" /><!-- IF text is not blank --><xsl:if test="($text != '') and (string-length($text)!= 0)"><!-- check if any of the keywords are found in the token, populate variable with the keywords found --><xsl:variable name="isKeyword"><xsl:call-template name="contains-keyword"><xsl:with-param name="keywords" select="$keywordsCheck" /><xsl:with-param name="word" select="$tokenCheck" /></xsl:call-template></xsl:variable><xsl:choose><xsl:when test="(string-length($isKeyword)!=0) and ($tokenCheck != '') and ($keywordsCheck != '')"><!-- highlight text (only use first keyword that is matched) --><xsl:call-template name="highlight-word"><xsl:with-param name="text" select="$token" /><xsl:with-param name="word" select="substring-before($isKeyword,' ')" /><xsl:with-param name="style" select="$style" /><xsl:with-param name="class" select="$class" /></xsl:call-template><xsl:value-of disable-output-escaping="yes" select="$sep" /></xsl:when><xsl:otherwise><!-- no highlight --><xsl:value-of disable-output-escaping="yes" select="concat($token, $sep)" /></xsl:otherwise></xsl:choose><!-- check remaining text for highlighting (recursive) --><xsl:call-template name="highlight"><xsl:with-param name="text" select="substring-after($text, $sep)" /><xsl:with-param name="keywords" select="$keywords" /><xsl:with-param name="sep" select="$sep" /><xsl:with-param name="style" select="$style" /><xsl:with-param name="class" select="$class" /></xsl:call-template></xsl:if></xsl:template><!--
==========================================================================
    Template: contains-keyword
 Description: Loops over a keyword string and checks if the specified word
              contains any. Returns the list of the keywords that were 
              matched.
  Parameters:
    <keywords> - keywords to be checked for words
    <word> - word to be found in keywords
    <sep> - separator (default: space)
========================================================================== --><xsl:template name="contains-keyword"><xsl:param name="keywords" select="''" /><xsl:param name="word" select="''" /><xsl:param name="sep" select="' '" /><!-- pad keywords --><xsl:variable name="padded-keywords" select="concat($keywords, ' ')" /><!-- if keywords string is not blank --><xsl:if test="($keywords!='') and (string-length($keywords)!=0)"><!-- get token --><xsl:variable name="token" select="substring-before($padded-keywords,$sep)" /><!-- lowercase token for matching --><xsl:variable name="tokenCheck" select="translate($token,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- lowercase word for matching --><xsl:variable name="wordCheck" select="translate($word,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- test if string lengths are within range: either length is greater than 1, or keyword length matches word length --><xsl:variable name="length-diff" select="number(string-length($word)) - number(string-length($token))" /><xsl:variable name="length-test"><xsl:if test="((string-length($token) = 1) and ($length-diff = 0)) or (string-length($token) &gt; 1)"><xsl:text>true</xsl:text></xsl:if></xsl:variable><!-- exclusion test: exclude 'and' and 'or' from matching --><xsl:variable name="exclude"><xsl:if test="($token = 'and') or ($token = 'or')"><xsl:text>true</xsl:text></xsl:if></xsl:variable><!-- if word contains token and passes the length test: output the token --><!-- insert "and ($length-test = 'true')" into the test statement below to include the results of the test --><xsl:if test="(contains($wordCheck, $tokenCheck)) and ($token != '') and ($word != '') and ($exclude != 'true')"><xsl:value-of select="concat($token,$sep)" /></xsl:if><!-- check remaining keywords for word (recursive) --><xsl:call-template name="contains-keyword"><xsl:with-param name="keywords" select="substring-after($keywords, $sep)" /><xsl:with-param name="word" select="$word" /><xsl:with-param name="sep" select="$sep" /></xsl:call-template></xsl:if></xsl:template><!--
==========================================================================
    Template: highlight-word
 Description: Highlight just the word, sans extra characters. 
  Parameters:
    <text> - text to be checked for highlighting
    <word> - word to be highlighted within text
    <style> - (Optional) CSS style of the highlight (default: "color:red;")
    <class> - (Optional) class attribute used for highlighted words. Takes
              precedence over the <style> parameter if specified
========================================================================== --><xsl:template name="highlight-word"><xsl:param name="text" select="''" /><xsl:param name="word" select="''" /><xsl:param name="style" select="'color:red;'" /><xsl:param name="class" select="''" /><xsl:if test="($text != '') and (string-length($text)!=0)"><!-- lowercase text for matching --><xsl:variable name="textCheck" select="translate($text,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- lowercase word for matching --><xsl:variable name="wordCheck" select="translate($word,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><xsl:choose><xsl:when test="(contains($textCheck, $wordCheck)) and ($text != '') and ($word != '')"><!-- get length of text before matched word --><xsl:variable name="before-length" select="string-length(substring-before($textCheck, $wordCheck))" /><!-- set before string --><xsl:variable name="before" select="substring($text,1,$before-length)" /><!-- get position of string after matched word --><xsl:variable name="after-length" select="$before-length + string-length($word) + 1" /><!-- set after string --><xsl:variable name="after" select="substring($text,$after-length)" /><!-- display before string --><xsl:value-of select="$before" /><!-- highlight original word from text (non-lowercase) --><xsl:element name="span"><!-- use: class or style attribute --><xsl:choose><xsl:when test="string-length($class)!=0"><xsl:attribute name="class"><xsl:value-of select="$class" /></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="style"><xsl:value-of select="$style" /></xsl:attribute></xsl:otherwise></xsl:choose><!-- display word --><xsl:value-of disable-output-escaping="yes" select="substring($text, $before-length + 1, string-length($word))" /></xsl:element><!-- check rest of text for highlighting (recursive) --><xsl:call-template name="highlight-word"><xsl:with-param name="text" select="$after" /><xsl:with-param name="word" select="$word" /><xsl:with-param name="style" select="$style" /><xsl:with-param name="class" select="$class" /></xsl:call-template></xsl:when><xsl:otherwise><!-- if word is not found, display rest of text --><xsl:value-of disable-output-escaping="yes" select="$text" /></xsl:otherwise></xsl:choose></xsl:if></xsl:template><!--
==========================================================================
    Template: contains-word
 Description: check if a block of text contains a whole word rather than
              a partial word. Prints '1' for every time it finds the word
              in the text.
  Parameters:
    <text> - text to be checked for words
    <word> - word to be found in text
    <sep> - separator (default: space)
========================================================================== --><xsl:template name="contains-word"><xsl:param name="text" select="''" /><xsl:param name="word" select="''" /><xsl:param name="sep" select="' '" /><!-- pad text --><xsl:variable name="padded-text" select="concat($text, $sep)" /><!-- if text is not blank --><xsl:if test="($text!='') and (string-length($text)!=0)"><!-- get token --><xsl:variable name="token" select="substring-before($padded-text,$sep)" /><!-- if word equals token, and neither are blank --><xsl:if test="($word = $token) and ($token != '') and ($word != '')"><xsl:text>1</xsl:text></xsl:if><!-- check remaining text for word (recursive) --><xsl:call-template name="contains-word"><xsl:with-param name="text" select="substring-after($text, $sep)" /><xsl:with-param name="word" select="$word" /><xsl:with-param name="sep" select="$sep" /></xsl:call-template></xsl:if></xsl:template><!--
==========================================================================
    Template: highlight-phrase
 Description: highlight keywords that are found within the associated
              text. Treats the keywords text as a phrase, not words, and
              only highlights the first instance of the phrase. Can be used
              for implementations such as suggestions.
  Parameters:
    <text> - block of text that contains phrase to be highlighted
    <keywords> - words that should be highlighted in text (phrase)
    <style> - (Optional) CSS style used for highlighted words
    <class> - (Optional) class attribute used for highlighted words. Takes
              precedence over the <style> parameter if specified
========================================================================== --><xsl:template name="highlight-phrase"><xsl:param name="text" select="''" /><xsl:param name="keywords" select="''" /><xsl:param name="style" select="'color:red;'" /><xsl:param name="class" select="''" /><!-- lowercase text for matching --><xsl:variable name="textCheck" select="translate($text,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- lowercase keywords for matching --><xsl:variable name="keywordsCheck" select="translate($keywords,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- check if the text contains the keywords phrase --><xsl:choose><xsl:when test="contains($textCheck, $keywordsCheck)"><!-- get length of text before matched word --><xsl:variable name="before-length" select="string-length(substring-before($textCheck, $keywordsCheck))" /><!-- set before string --><xsl:variable name="before" select="substring($text,1,$before-length)" /><!-- get position of string after matched word --><xsl:variable name="after-length" select="$before-length + string-length($keywords) + 1" /><!-- set after string --><xsl:variable name="after" select="substring($text,$after-length)" /><!-- display before string --><xsl:value-of disable-output-escaping="yes" select="$before" /><!-- highlight original word from text (non-lowercase) --><xsl:element name="span"><!-- use: class or style attribute --><xsl:choose><xsl:when test="string-length($class)!=0"><xsl:attribute name="class"><xsl:value-of select="$class" /></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="style"><xsl:value-of select="$style" /></xsl:attribute></xsl:otherwise></xsl:choose><!-- display word --><xsl:value-of disable-output-escaping="yes" select="substring($text, $before-length + 1, string-length($keywords))" /></xsl:element><!-- display after --><xsl:value-of disable-output-escaping="yes" select="$after" /></xsl:when><xsl:otherwise><!-- if text does not contain keywords, return text --><xsl:value-of disable-output-escaping="yes" select="$text" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
  Stylesheet: product-search.xsl
     Company: RedDot Solutions
     Version: 0.9.3 (October 11, 2007)
      Author: Jack Marczewski [RedDot]
 Description: Display product search results
      Notice: 
========================================================================== --><xsl:param name="keywords" /><xsl:param name="pb" /><!--   
==========================================================================
    Template: product-search
    Description: Displays verity search results displaying all products.
========================================================================== --><xsl:template match="product-search"><xsl:apply-templates select="product-search-results" /><!-- 19Jan,2008, Remedy#INC00000062086, internationalization --><script>

if($('#focusProductsText').length) {
	$('#focusProductsText').html( $('#focusProducts').html());
}

if($('#otherProductsText').length) {
	
$('#otherProductsText').html( $('#otherProducts').html());
}
if($('.view_more_prod').length) {
	$('.view_more_prod').html( $('#pbViewMoreProduct').html());
}

if($('#pbSearchError1').length) {
	$('#pbSearchError1').html( $('#pbPageSearchError1').html());
}

if($('#pbSearchError2').length) {
	$('#pbSearchError2').html( $('#pbPageSearchError2').html());
}

if($('#pbSearchError3').length) {
	$('#pbSearchError3').html( $('#pbPageSearchError3').html());
}

if($('#pbSearchError4').length) {
	$('#pbSearchError4').html( $('#pbPageSearchError4').html());
}

if($('#paginationViewAllText').length) {
	$('#paginationViewAllText').html( $('#paginationViewAll').html());
}





</script></xsl:template><!--
==========================================================================
    Template: product-search-results
    Description: Displays verity search results displaying all products.
========================================================================== --><xsl:template match="product-search-results"><!--Variable name =request value ,gets the value of clicked alphabet in request --><xsl:variable name="requestValue">R</xsl:variable><!--Variable name =requestviewmore ,gets the value of view More link in request --><xsl:variable name="requestViewMore"></xsl:variable><!--Variable name =search parameter ,gets the value of view More link in request --><xsl:variable name="string2"><xsl:value-of select="../search-params" /></xsl:variable><!--Variable name =microsite_number ,gets the value of microsites starting with number --><xsl:variable name="microsite_number"><xsl:for-each select="product[substring(product.Name,1,1) &lt;'9' and microsite='Yes' and $requestValue='number']"><xsl:value-of select="position()" /></xsl:for-each></xsl:variable><!--Variable name =microsite_alpha ,gets the value of microsites starting with alphabets --><xsl:variable name="microsite_alpha"><xsl:for-each select="product[translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1) and microsite='Yes' ]"><xsl:value-of select="position()" /></xsl:for-each></xsl:variable><!--Variable name =microsite_view ,gets the value of microsites  --><xsl:variable name="microsite_view"><xsl:for-each select="product[microsite='Yes' and $requestValue='viewAll']"><xsl:value-of select="position()" /></xsl:for-each></xsl:variable><!--Variable name = count_top_num ,gets the value of top products starting with number --><xsl:variable name="count_top_num"><xsl:value-of select="count(product[substring(product.Name,1,1) &lt;'9' and microsite='' and $requestValue='number' and string-length(topProducts)&gt;'1'])" /></xsl:variable><!--Variable name = count_top_view ,gets the value of top products  --><xsl:variable name="count_top_view"><xsl:value-of select="count(product[$requestValue='viewAll' and  microsite='' and string-length(topProducts)&gt;'1'])" /></xsl:variable><!--Variable name = count_top_alpha ,gets the value of top products starting with alphabet --><xsl:variable name="count_top_alpha"><xsl:value-of select="count(product[translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1) and  microsite='' and string-length(topProducts)&gt;'1'])" /></xsl:variable><!--Variable name = count_view_more_number ,gets the count of other products starting with number --><xsl:variable name="count_view_more_number"><xsl:value-of select="count(product[substring(product.Name,1,1) &lt;'9' and microsite='' and $requestValue='number' ])" /></xsl:variable><!--Variable name = count_view_more_alpha ,gets the count of other products starting with alphabet --><xsl:variable name="count_view_more_alpha"><xsl:value-of select="count(product[microsite='' and translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1)])" /></xsl:variable><!--Variable name = count_view_more_alpha ,gets the count of other products --><xsl:variable name="count_view_more_viewAll"><xsl:value-of select="count(product[microsite='' and $requestValue='viewAll' ])" /></xsl:variable><!-- display search summary or search error --><xsl:choose><xsl:when test="@hits &gt; 0"><!--Start alphabetic pagination--><xsl:variable name="alphabet">0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><!--variable initializes search parameters--><xsl:variable name="s-parameters"><xsl:call-template name="buildSearchParams"><xsl:with-param name="params" select="../search-params" /></xsl:call-template></xsl:variable><!--Start alphabetic pagination--><div class="dottedBorder"><ul class="productPagination"><xsl:call-template name="alphabetPagination"><xsl:with-param name="end" select="string-length($alphabet)+2" /><xsl:with-param name="alphabet-listing" select="$alphabet" /><xsl:with-param name="search" select="$s-parameters" /><xsl:with-param name="start" select="0" /><xsl:with-param name="request" select="$requestValue" /></xsl:call-template></ul></div><!-- BEGIN M73 Product Teaser --><!--test if microsites are present starting with number--><!--display microsite odd and even depending upon the position--><xsl:if test="$microsite_number &gt; '0'"><div class="focus_products"><p class="page-heading-blue"><span id="focusProductsText">Focus Products</span></p><xsl:for-each select="product[substring(product.Name,1,1) &lt;'9' and microsite='Yes' and $requestValue='number']"><xsl:if test="position() mod 2 ='1'"><div class="left-sub-cont"><div class="enhanced_perf marginTop15"><div class="enhanced_performance"><div><h2 class="blue_bar" /><span><!-- 3-Nov-2008, artf809809 --><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable>
iconpath<xsl:copy-of select="substring(./productIcon,0,11)" /><!-- disabled 20091105 tdavis xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" / --><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><img alt="{$product-name}" class="padding5 floatLeft" src="{$product-icon-link}" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;" width="45" /><!--                             <img width="45" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;"   class="padding5 floatLeft">
                                <xsl:attribute name="src">
                                    <xsl:value-of select="$rdeProjectID"/><xsl:value-of select="productIcon"/>
                                </xsl:attribute> 
                                <xsl:attribute name="alt">
                                   <xsl:value-of select="product.Name"/>
                                </xsl:attribute> 
                             </img>      --></span><h5 class="teaserTitle paddingTop5"><a><xsl:attribute name="href"><xsl:value-of select="concat(name)" /></xsl:attribute><strong><xsl:value-of disable-output-escaping="yes" select="product.Name" /></strong></a></h5><p class="teaserText marginRight5"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></p><div class="clearAll" /></div></div></div><div class="clear" style="padding: 0pt;" /></div></xsl:if><xsl:if test="position() mod 2 ='0'"><div class="right-sub-cont"><div class="enhanced_perf marginTop15"><div class="enhanced_performance"><div><h2 class="blue_bar" /><span><!-- 3-Nov-2008, artf809809 --><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><!-- disabled 20091105 tdavis xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" / --><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><img alt="{$product-name}" class="padding5 floatLeft" src="{$product-icon-link}" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;" width="45" /><!--                            <img width="45" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;"   class="padding5 floatLeft">
                               <xsl:attribute name="src">
                               <xsl:value-of select="$rdeProjectID"/><xsl:value-of select="productIcon"/>
                               </xsl:attribute> 
                               <xsl:attribute name="alt">
                               <xsl:value-of select="product.Name"/>
                               </xsl:attribute> 
                             </img>     --></span><h5 class="teaserTitle paddingTop5"><a><xsl:attribute name="href"><xsl:value-of select="concat(name)" /></xsl:attribute><strong><xsl:value-of disable-output-escaping="yes" select="product.Name" /></strong></a></h5><p class="teaserText marginRight5"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></p><div class="clearAll" /></div></div></div><div class="clear" style="padding: 0pt;" /></div></xsl:if></xsl:for-each><div class="clearAll" /></div></xsl:if><xsl:if test="$microsite_alpha &gt; '0'"><div class="focus_products"><p class="page-heading-blue"><span id="focusProductsText">Focus Products</span></p><xsl:for-each select="product[translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1) and microsite='Yes' ]"><xsl:if test="position() mod 2 ='1'"><div class="left-sub-cont"><div class="enhanced_perf marginTop15"><div class="enhanced_performance"><div><h2 class="blue_bar" /><span><!-- 3-Nov-2008, artf809809 --><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><!-- disabled 20091105 tdavis xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" / --><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><img alt="{$product-name}" class="padding5 floatLeft" src="{$product-icon-link}" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;" width="45" /><!--                               <img width="45" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;"   class="padding5 floatLeft">
                          <xsl:attribute name="src">
                        <xsl:value-of select="$rdeProjectID"/><xsl:value-of select="productIcon"/>
                       </xsl:attribute> 
                         <xsl:attribute name="alt">
                    <xsl:value-of select="product.Name"/>
                       </xsl:attribute> 
                      
                         </img>      --></span><h5 class="teaserTitle paddingTop5"><a><xsl:attribute name="href"><xsl:value-of select="concat(name)" /></xsl:attribute><strong><xsl:value-of disable-output-escaping="yes" select="product.Name" /></strong></a></h5><p class="teaserText marginRight5"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></p><div class="clearAll" /></div></div></div><div class="clear" style="padding: 0pt;" /></div></xsl:if><xsl:if test="position() mod 2 ='0'"><div class="right-sub-cont"><div class="enhanced_perf marginTop15"><div class="enhanced_performance"><div><h2 class="blue_bar" /><span><!-- 3-Nov-2008, artf809809 --><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><!-- disabled 20091105 tdavis xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" / --><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><img alt="{$product-name}" class="padding5 floatLeft" src="{$product-icon-link}" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;" width="45" /><!-- <img width="45" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;"   class="padding5 floatLeft">
                          <xsl:attribute name="src">
                        <xsl:value-of select="$rdeProjectID"/><xsl:value-of select="productIcon"/>
                       </xsl:attribute> 
                         <xsl:attribute name="alt">
                    <xsl:value-of select="product.Name"/>
                       </xsl:attribute> 
                      
                         </img>      --></span><h5 class="teaserTitle paddingTop5"><a><xsl:attribute name="href"><xsl:value-of select="concat(name)" /></xsl:attribute><strong><xsl:value-of disable-output-escaping="yes" select="product.Name" /></strong></a></h5><p class="teaserText marginRight5"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></p><div class="clearAll" /></div></div></div><div class="clear" style="padding: 0pt;" /></div></xsl:if></xsl:for-each><div class="clearAll" /></div></xsl:if><xsl:if test="$microsite_view &gt; '0'"><div class="focus_products"><p class="page-heading-blue"><span id="focusProductsText">Focus Products</span></p><xsl:for-each select="product[microsite='Yes' and $requestValue='viewAll']"><xsl:if test="position() mod 2 ='1'"><div class="left-sub-cont"><div class="enhanced_perf marginTop15"><div class="enhanced_performance"><div><h2 class="blue_bar" /><span><!-- 3-Nov-2008, artf809809 --><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><!-- disabled 20091105 tdavis xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" / --><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><img alt="{$product-name}" class="padding5 floatLeft" src="{$product-icon-link}" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;" width="45" /><!--                             <img width="45" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;"   class="padding5 floatLeft">
                          <xsl:attribute name="src">
                        <xsl:value-of select="$rdeProjectID"/><xsl:value-of select="productIcon"/>
                       </xsl:attribute> 
                         <xsl:attribute name="alt">
                    <xsl:value-of select="product.Name"/>
                       </xsl:attribute> 
                      
                         </img>     --></span><h5 class="teaserTitle paddingTop5"><a><xsl:attribute name="href"><xsl:value-of select="concat(name)" /></xsl:attribute><strong><xsl:value-of disable-output-escaping="yes" select="product.Name" /></strong></a></h5><p class="teaserText marginRight5"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></p><div class="clearAll" /></div></div></div><div class="clear" style="padding: 0pt;" /></div></xsl:if><xsl:if test="position() mod 2 ='0'"><div class="right-sub-cont"><div class="enhanced_perf marginTop15"><div class="enhanced_performance"><div><h2 class="blue_bar" /><span><!-- 3-Nov-2008, artf809809 --><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><!-- disabled 20091105 tdavis xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" / --><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><img alt="{$product-name}" class="padding5 floatLeft" src="{$product-icon-link}" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;" width="45" /><!--                             <img width="45" style="padding-right: 8px; padding-left: 0px; margin-left: 0px; margin-right: 0px;"   class="padding5 floatLeft">
                          <xsl:attribute name="src">
                        <xsl:value-of select="$rdeProjectID"/><xsl:value-of select="productIcon"/>
                       </xsl:attribute> 
                         <xsl:attribute name="alt">
                    <xsl:value-of select="product.Name"/>
                       </xsl:attribute> 
                      
                         </img>      --></span><h5 class="teaserTitle paddingTop5"><a><xsl:attribute name="href"><xsl:value-of select="concat(name)" /></xsl:attribute><strong><xsl:value-of disable-output-escaping="yes" select="product.Name" /></strong></a></h5><p class="teaserText marginRight5"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></p><div class="clearAll" /></div></div></div><div class="clear" style="padding: 0pt;" /></div></xsl:if></xsl:for-each><div class="clearAll" /></div></xsl:if><!-- 4-Nov-2208, artf810261, Hide other products title if not visible --><xsl:if test="$count_view_more_viewAll &gt; '0' or $count_view_more_alpha &gt; '0' or $count_view_more_number &gt; '0'"><div class="dottedBorder"><p class="page-heading-grey"><span id="otherProductsText">Other Products</span></p><ul class="allproduct_category"><xsl:for-each select="product[microsite = '' and string-length(topProducts)&gt;'1' and $requestValue='number']"><xsl:if test="string-length($requestViewMore) &lt; 1"><xsl:if test="position() &lt; '13'"><xsl:if test="string-length(topProducts)&gt;'0'"><xsl:variable name="topProduct"><xsl:call-template name="getSubstring"><xsl:with-param name="string1" select="topProducts" /><xsl:with-param name="string2" select="$string2" /><xsl:with-param name="end-string2" select="string-length($string2)+1" /><xsl:with-param name="start-string2" select="0" /></xsl:call-template></xsl:variable><xsl:if test="$topProduct &gt; '0'"><xsl:choose><xsl:when test="$requestValue='number'"><xsl:if test="substring(product.Name,1,1) &lt;'9'"><xsl:if test="position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:when></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:if><xsl:if test="string-length($requestViewMore) &gt; 1"><xsl:if test="string-length(topProducts)&gt;'0'"><xsl:variable name="topProduct"><xsl:call-template name="getSubstring"><xsl:with-param name="string1" select="topProducts" /><xsl:with-param name="string2" select="$string2" /><xsl:with-param name="end-string2" select="string-length($string2)+1" /><xsl:with-param name="start-string2" select="0" /></xsl:call-template></xsl:variable><xsl:if test="$topProduct &gt; '0'"><xsl:choose><xsl:when test="$requestValue='number'"><xsl:if test="substring(product.Name,1,1) &lt;'9'"><xsl:if test="position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:when></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:for-each><xsl:for-each select="product[microsite = '' and string-length(topProducts)&gt;'1' and $requestValue='viewAll']"><xsl:if test="string-length($requestViewMore) &lt; 1"><xsl:if test="position() &lt; '13'"><xsl:if test="string-length(topProducts)&gt;'0'"><xsl:variable name="topProduct"><xsl:call-template name="getSubstring"><xsl:with-param name="string1" select="topProducts" /><xsl:with-param name="string2" select="$string2" /><xsl:with-param name="end-string2" select="string-length($string2)+1" /><xsl:with-param name="start-string2" select="0" /></xsl:call-template></xsl:variable><xsl:if test="$topProduct &gt; '0'"><xsl:choose><xsl:when test="$requestValue='viewAll'"><xsl:if test="position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:when></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:if><xsl:if test="string-length($requestViewMore) &gt; 1"><xsl:if test="string-length(topProducts)&gt;'0'"><xsl:variable name="topProduct"><xsl:call-template name="getSubstring"><xsl:with-param name="string1" select="topProducts" /><xsl:with-param name="string2" select="$string2" /><xsl:with-param name="end-string2" select="string-length($string2)+1" /><xsl:with-param name="start-string2" select="0" /></xsl:call-template></xsl:variable><xsl:if test="$topProduct &gt; '0'"><xsl:choose><xsl:when test="$requestValue='viewAll'"><xsl:if test="position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:when></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:for-each><xsl:for-each select="product[microsite = '' and string-length(topProducts)&gt;'1' and translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1)]"><xsl:if test="string-length($requestViewMore) &lt; 1"><xsl:if test="position() &lt; '13'"><xsl:if test="string-length(topProducts)&gt;'0'"><xsl:variable name="topProduct"><xsl:call-template name="getSubstring"><xsl:with-param name="string1" select="topProducts" /><xsl:with-param name="string2" select="$string2" /><xsl:with-param name="end-string2" select="string-length($string2)+1" /><xsl:with-param name="start-string2" select="0" /></xsl:call-template></xsl:variable><xsl:if test="$topProduct &gt; '0'"><xsl:choose><xsl:when test="translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1)"><xsl:if test="position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:when></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:if><xsl:if test="string-length($requestViewMore) &gt; 1"><xsl:if test="string-length(topProducts)&gt;'0'"><xsl:variable name="topProduct"><xsl:call-template name="getSubstring"><xsl:with-param name="string1" select="topProducts" /><xsl:with-param name="string2" select="$string2" /><xsl:with-param name="end-string2" select="string-length($string2)+1" /><xsl:with-param name="start-string2" select="0" /></xsl:call-template></xsl:variable><xsl:if test="$topProduct &gt; '0'"><xsl:choose><xsl:when test="translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1)"><xsl:if test="position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="position() mod 4 = 1 and position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:when></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:for-each><xsl:for-each select="product[substring(product.Name,1,1) &lt;'9' and microsite='' and $requestValue='number' and topProducts = '']"><xsl:if test="string-length($requestViewMore) &lt; 1"><xsl:if test="$count_top_num+position() &lt; '13'"><xsl:if test="$count_top_num+position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="$count_top_num+position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="$count_top_num+position() mod 4 = 1 and $count_top_num+position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="$count_top_num+position() mod 4 = 1 and $count_top_num+position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:if><xsl:if test="string-length($requestViewMore) &gt; 1"><xsl:if test="$count_top_num+position() mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="$count_top_num+position() mod 4 &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="$count_top_num+position() mod 4 = 1 and $count_top_num+position() &gt; 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="$count_top_num+position() mod 4 = 1 and $count_top_num+position() = 1"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:for-each><xsl:for-each select="product[microsite='' and $requestValue='viewAll' and topProducts = '']"><xsl:if test="string-length($requestViewMore) &lt; 1"><xsl:if test="$count_top_view+position() &lt; '13'"><xsl:if test="($count_top_view+position()) mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_view+position()) mod 4 = 2"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_view+position()) mod 4 = 3"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_view+position()) mod 4 = 1 "><h4>  </h4><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:if><xsl:if test="string-length($requestViewMore) &gt; 1"><xsl:if test="($count_top_view+position()) mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_view+position()) mod 4 = 2"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_view+position()) mod 4 = 3"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_view+position()) mod 4 = 1 "><h4>  </h4><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:for-each><xsl:for-each select="product[translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($requestValue,1,1) and microsite='' and topProducts='' ]"><xsl:if test="string-length($requestViewMore) &lt; 1"><xsl:if test="$count_top_alpha+position() &lt; '13'"><xsl:if test="($count_top_alpha+position()) mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_alpha+position()) mod 4 = 2"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_alpha+position()) mod 4 = 3"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_alpha+position()) mod 4 = 1 "><h4>  </h4><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:if><xsl:if test="string-length($requestViewMore) &gt; 1"><xsl:if test="($count_top_alpha+position()) mod 4 = 0"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory last</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_alpha+position()) mod 4 = 2"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_alpha+position()) mod 4 = 3"><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param></xsl:call-template></xsl:if><xsl:if test="($count_top_alpha+position()) mod 4 = 1 "><h4>  </h4><xsl:call-template name="product-item"><xsl:with-param name="class">pcategory</xsl:with-param><xsl:with-param name="newline">true</xsl:with-param></xsl:call-template></xsl:if></xsl:if></xsl:for-each><!-- END M73 Product Teaser --></ul><div class="clearAll" /></div></xsl:if><xsl:if test="$count_view_more_number &gt; 12"><xsl:if test="string-length($requestViewMore) &lt; 1"><a class="view_more_prod" title="View more products"><xsl:attribute name="href"><xsl:value-of select="$s-parameters" />&amp;clicked=<xsl:value-of select="$requestValue" />&amp;viewMore=yes
              </xsl:attribute>
               View more products
               </a></xsl:if></xsl:if><xsl:if test="$count_view_more_alpha &gt; 12"><xsl:if test="string-length($requestViewMore) &lt; 1"><a class="view_more_prod" title="View more products"><xsl:attribute name="href"><xsl:value-of select="$s-parameters" />&amp;clicked=<xsl:value-of select="$requestValue" />&amp;viewMore=yes
              </xsl:attribute>
              View more products
             </a></xsl:if></xsl:if><xsl:if test="$count_view_more_viewAll &gt; 12"><xsl:if test="string-length($requestViewMore) &lt; 1"><a class="view_more_prod" title="View more products"><xsl:attribute name="href"><xsl:value-of select="$s-parameters" />&amp;clicked=<xsl:value-of select="$requestValue" />&amp;viewMore=yes
            </xsl:attribute>
           View more products 
      </a></xsl:if></xsl:if></xsl:when><xsl:otherwise><!-- start search error --><!-- 19Jan,2008, Remedy#INC00000062086, internationalization --><p class="paddingTop22"><span id="pbSearchError1"> Your Serach For </span> '<span class="keyword"><xsl:value-of select="$keywords" /></span>' <span id="pbSearchError2">returned no results.</span></p><h5 class="teaserTitle paddingTop20"><strong><span id="pbSearchError3">Search Tips:</span></strong></h5><p class="paddingTop3"><span id="pbSearchError4">Check the spelling of keywords you ’ve entered or try searching for related words.</span></p><!-- end search error --></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: product-item
    Description: Displays individual product teaser.
    Parameters:
      <class> - class of the teaser item (default: pcategory)
========================================================================== --><xsl:template name="product-item"><xsl:param name="class" select="pcategory" /><xsl:param name="newline" select="false" /><xsl:variable name="wrapcode"><xsl:text>&lt;/ul&gt;&lt;ul class="allproduct_category"&gt;</xsl:text></xsl:variable><xsl:if test="$newline = 'true'"><xsl:value-of disable-output-escaping="yes" select="$wrapcode" /></xsl:if><li class="allpcategory"><ul class="allproduct_category_list"><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><li><img alt="{$product-name}" src="{$product-icon-link}" width="81" /></li><li><a href="{$product-link}"><xsl:value-of disable-output-escaping="yes" select="product.Name" /></a></li><li class="description"><xsl:value-of disable-output-escaping="yes" select="productDescription" /></li></ul></li></xsl:template><!--
==========================================================================
    Templates: topFiveProducts and topFiveProductItem
    Description: Displays top-5 product list for a product category.
========================================================================== --><xsl:template match="topFiveProducts"><ul style="list-style:none;padding:0;font-size:0.9em; margin:0 5px 0 5px;"><xsl:for-each select="topFiveProduct"><xsl:call-template name="topFiveProductItem" /></xsl:for-each></ul></xsl:template><xsl:template name="topFiveProductItem"><xsl:variable name="product-icon"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="./productIcon" /></xsl:call-template></xsl:variable><xsl:variable name="product-icon-link" select="concat('/', $rdePrefix, '/xbcr/', $rdeSessionID, '/', $rdeProjectID, '/', $product-icon)" /><xsl:variable name="product-icon" select="concat(./productIcon)" /><xsl:variable name="product-link" select="concat(./name)" /><xsl:variable name="product-name" select="concat(./product.Name)" /><li style="padding:0;margin:0;_margin-top:-10px;"><ul style="list-style:none;padding:0;font-size:0.9em; margin:0 5px 0 5px;"><li style="display:inline;margin:0 3px 0 0;padding:0; float:left;"><img alt="{$product-name}" src="{$product-icon-link}" style="border:solid #ccc 2px;" width="40" /></li><li style="display:inline; float:left;"><a href="{$product-link}" style="text-transform:uppercase"><xsl:value-of select="product.Name" /></a><p style="padding-top:3px;font-size:0.9em; color:#999;"><xsl:value-of select="productDescription" /></p></li></ul><div class="clear" /></li></xsl:template><xsl:call-template name="product-listing" /><!--
==========================================================================
    Template: Pagination
    Description: will check if a alphabet is a link or not and form pagination.
========================================================================== --><xsl:template name="alphabetPagination"><xsl:param name="end" select="10" /><xsl:param name="start" select="10" /><xsl:param name="alphabet-listing" select="Z" /><xsl:param name="search" select="A" /><xsl:param name="request" select="A" /><xsl:if test="$start &lt; $end"><xsl:variable name="selected"><xsl:for-each select="./product"><xsl:if test="$start &gt; 10"><xsl:if test="translate(substring(product.Name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') = substring($alphabet-listing,$start,1)"><xsl:value-of select="substring($alphabet-listing,$start,1)" /></xsl:if></xsl:if></xsl:for-each></xsl:variable><xsl:variable name="selected_z"><xsl:for-each select="./product"><xsl:if test="$start &gt; 10"><xsl:if test="translate(substring(product.Name,1,1),'z','Z') = 'Z' "><xsl:value-of select="product.Name" /></xsl:if></xsl:if></xsl:for-each></xsl:variable><xsl:variable name="numbersSelected"><xsl:if test="$start &lt; 10"><xsl:for-each select="./product"><xsl:if test="substring(product.Name,1,1) = 0">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 1">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 2">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 3">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 4">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 5">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 6">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 7">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) = 8">
 
0
</xsl:if><xsl:if test="substring(product.Name,1,1) =9">
 
0
</xsl:if></xsl:for-each></xsl:if></xsl:variable><xsl:variable name="start1"><xsl:value-of select="$start+1" /></xsl:variable><xsl:value-of select="substring($numbersSelected,1,1)" /><xsl:variable name="notSelected"><xsl:choose><xsl:when test="not(contains($numbersSelected, substring($alphabet-listing,$start,1)))"><xsl:if test="$start &lt; '10'">
 

1

 </xsl:if></xsl:when></xsl:choose></xsl:variable><xsl:choose><xsl:when test="contains($selected, substring($alphabet-listing,$start,1))"><li><A class="pagination"><xsl:if test="not($request=substring($alphabet-listing,$start,1))"><xsl:attribute name="href"><xsl:value-of select="$search" />&amp;clicked=<xsl:value-of select="substring($alphabet-listing,$start,1)" /></xsl:attribute><xsl:attribute name="id"> anchor_<xsl:value-of select="substring($alphabet-listing,$start,1)" /></xsl:attribute><xsl:if test="$start &gt; 10"><xsl:value-of select="substring($alphabet-listing,$start,1)" /></xsl:if></xsl:if><xsl:if test="$request = substring($alphabet-listing,$start,1)"><xsl:attribute name="style">
Color:#333;text-decoration:none;
</xsl:attribute><xsl:value-of select="substring($alphabet-listing,$start,1)" /></xsl:if></A></li></xsl:when><xsl:when test="contains($numbersSelected,'0')"><xsl:if test="$start = '1'"><li><a class="pagination"><xsl:if test="not($request = 'number')"><xsl:attribute name="href">&amp;chunk=1;&amp;chunksize=30 </xsl:attribute><xsl:if test="string-length($search) &gt; '0'"><xsl:attribute name="href"><xsl:value-of select="$search" />&amp;clicked=number
 </xsl:attribute></xsl:if><xsl:attribute name="id">anchor_number</xsl:attribute>
  0-9
</xsl:if><xsl:if test="$request = 'number'"><xsl:attribute name="style">
Color:#333;text-decoration:none;

</xsl:attribute>
 0-9
</xsl:if></a></li></xsl:if></xsl:when><xsl:when test="contains($notSelected, substring($alphabet-listing,$start+1,1))"><xsl:if test="$start = '1'"> 
0-9
 
</xsl:if></xsl:when><xsl:otherwise><xsl:if test="$start &gt;'10' "><li><xsl:value-of select="substring($alphabet-listing,$start,1)" /></li></xsl:if><xsl:if test="$start = '35'"><xsl:if test="string-length($selected_z) &lt;'1'"><li>Z</li></xsl:if></xsl:if></xsl:otherwise></xsl:choose><xsl:if test="$start ='36'"><li><A class="pagination"><!-- 19Jan,2008, Remedy#INC00000062086, internationalization --><xsl:attribute name="id"><xsl:text>paginationViewAllText</xsl:text></xsl:attribute><xsl:if test="not($request = 'viewAll')"><xsl:attribute name="href"><xsl:value-of select="$search" />&amp;clicked=viewAll

 </xsl:attribute>View All </xsl:if><xsl:if test="($request = 'viewAll')"><xsl:attribute name="style">
Color:#333;text-decoration:none;

</xsl:attribute>
View All 
</xsl:if></A></li></xsl:if><xsl:call-template name="alphabetPagination"><xsl:with-param name="end" select="$end" /><xsl:with-param name="start" select="$start+1" /><xsl:with-param name="alphabet-listing" select="$alphabet-listing" /><xsl:with-param name="search" select="$search" /><xsl:with-param name="request" select="$request" /></xsl:call-template></xsl:if></xsl:template><!--
==========================================================================
    Template: getSubstring
    Description: will check if a particular top product is a substring of current request.
========================================================================== --><xsl:template name="getSubstring"><xsl:param name="string1" select="A" /><xsl:param name="string2" select="A" /><xsl:param name="end-string2" select="0" /><xsl:param name="start-string2" select="0" /><xsl:if test="string-length($string2)='0'">
1
</xsl:if><xsl:if test="string-length($string2) &gt; '0'"><xsl:if test="$start-string2 &lt; $end-string2"><xsl:if test="contains($string2,substring($string2,$start-string2,32))">
1
<xsl:call-template name="getSubstring"><xsl:with-param name="end-string2" select="end-string2" /><xsl:with-param name="start-string2" select="$start-string2+32" /><xsl:with-param name="string1" select="$string1" /><xsl:with-param name="string2" select="$string2" /></xsl:call-template></xsl:if><xsl:if test="not(contains($string2,substring($string2,$start-string2,32)))">
0
</xsl:if></xsl:if></xsl:if></xsl:template><!--
==========================================================================
  Stylesheet: faq-search.xsl
     Company: RedDot Solutions
     Version: 0.7
      Author: Jack Marczewski [RedDot]
 Description: Display search results
      Notice: 
========================================================================== --><xsl:param name="keywords" /><xsl:param name="faqguid" /><xsl:param name="faqid" /><!--
==========================================================================
    Template: faq-search
    Description: Top-Level match. Applies only select child templates.
========================================================================== --><xsl:template match="faq-search"><xsl:apply-templates select="faq-search-results" /></xsl:template><!--
==========================================================================
    Template: faq-search-results
    Description: Displays verity search results comprising faq search.
========================================================================== --><xsl:template match="faq-search-results"><!-- begin FAQ Body --><div id="faq_result"><xsl:choose><xsl:when test="@hits = 0"><!-- display nothing --></xsl:when><xsl:otherwise><!-- begin Questions: hide if search by GUID or ID --><xsl:if test="(string-length($faqguid)=0) and (string-length($faqid)=0)"><div class="results"><h2 class="titleGrey marginTop5"><!-- TODO: use label --><script><xsl:text> document.write(document.getElementById('FAQ_msg1').innerHTML)  ;  </xsl:text></script><xsl:text> : "</xsl:text><xsl:value-of select="$keywords" /><xsl:text>"</xsl:text></h2><ol class="questionList"><xsl:for-each select="content"><li><a href="#{faq_id}" id="faq_jump" name="{name}"><xsl:value-of disable-output-escaping="yes" select="faq_question" /></a></li></xsl:for-each></ol></div></xsl:if><!-- end Questions --><!-- begin Answers --><div id="faq_ques_answers"><ol><xsl:for-each select="content"><a name="{faq_id}" /><li><span><xsl:value-of disable-output-escaping="yes" select="faq_question" /></span><ul class="faq_answer"><li><!-- TODO: use label --><h4>Answer:</h4><p><xsl:value-of disable-output-escaping="yes" select="faq_answer" /></p><p align="right" class="back_to_top"><a href="#"><script> document.write(document.getElementById('backToTop').innerHTML)  ; </script></a></p></li></ul></li></xsl:for-each></ol></div><!-- end Answers --></xsl:otherwise></xsl:choose></div><!-- end FAQ Body --></xsl:template><!--
==========================================================================
  Stylesheet: download-listing.xsl
     Company: RedDot Solutions
     Version: 0.5
      Author: Jack Marczewski [RedDot]
 Description: Display product search results
      Notice: 
========================================================================== --><xsl:param name="section" /><!--
==========================================================================
    Template: download-listing
    Description: Top-Level match. Applies only select child templates.
========================================================================== --><xsl:template match="download-listing"><div class="download_listing"><h3 class="marginTop20"><xsl:value-of select="$section" /></h3><xsl:choose><xsl:when test="count(//display-listing) &gt; 0"><ul><xsl:apply-templates select="display-listing" /></ul></xsl:when><xsl:otherwise><span>No Listings Found.</span></xsl:otherwise></xsl:choose></div></xsl:template><!--
==========================================================================
    Template: download-listing-results
    Description: Displays verity search results comprising site search.
========================================================================== --><xsl:template match="download-listing-results"><!-- TODO: download-listing --><xsl:for-each select="content"><li style="padding:10px 0 10px 0; margin:0;border-bottom:dotted #ccc 1px;"><ul style="margin:0; padding:0; list-style:none; width:520px;"><li style="display:inline; float:left; width:240px; padding:0 10px 0 0; margin:0 10px 0 0;"><h4 style="margin:0; padding:0; background:url(images/band.gif) no-repeat left;padding-left:17px;"><xsl:choose><xsl:when test="string-length(title)!=0"><xsl:value-of disable-output-escaping="yes" select="title" /></xsl:when><xsl:otherwise><xsl:value-of select="name" /></xsl:otherwise></xsl:choose></h4><p style="font-size:0.85em;margin-top:5px;"><!-- TODO: teaser - is this supposed to be the context?? --><xsl:value-of select="context" /></p><p style="font-size:0.85em;margin-top:5px;"><!-- TODO: insert date from context tag/attribute --><xsl:text>11/11/2006</xsl:text></p></li><!-- TODO: get list of downloads for this file --><li style="display:inline; float:left; width:240px; padding:0 10px 0 0; margin:0 10px 0 0;"><ul style="margin:0; padding:0; list-style:none;"><li style="padding-bottom:5px;font-size:0.9em;"><a href="#" style="background:url(images/icn_download.gif) no-repeat left;padding-left:15px;">File Type</a> (File size)</li><li style="font-size:0.9em;"><a href="#" style="background:url(images/icn_download.gif) no-repeat left;padding-left:15px;">File Type</a> (File size)</li></ul></li></ul><div class="clear" /></li></xsl:for-each></xsl:template><xsl:template match="hidden"><!-- do nothing --></xsl:template><!--
==========================================================================
  Stylesheet: news-listing.xsl
     Company: RedDot Solutions
     Version: 0.7
      Author: Jack Marczewski [RedDot]
      Notice: 
========================================================================== --><!--
==========================================================================
    Template: news-listing
    Description: Top-Level match. Applies only select child templates.
========================================================================== --><xsl:template match="news-listing"><!-- 14Jan,2008, Remedy#INC00000062086, internationalization --><!--    <h3 style="margin-top: 20px;">Latest News</h3>  --><h3 style="margin-top: 20px;"><script> document.write(document.getElementById('newsDateOrderMsg').innerHTML)  ; </script></h3><xsl:apply-templates select="news-listing-results" /></xsl:template><!--
==========================================================================
    Template: news-listing-results
    Description: Displays verity search results comprising news listings.
========================================================================== --><xsl:template match="news-listing-results"><xsl:variable name="keywords" select="../keywords" /><xsl:choose><xsl:when test="@hits &lt; 1 or not(@hits)"><!-- 14Jan,2008, Remedy#INC00000062086, internationalization --><div><script> document.write(document.getElementById('noNewsMsg1').innerHTML)  ; </script></div></xsl:when><xsl:otherwise><div id="latest_news"><ul><xsl:for-each select="content"><li class="news_listing"><div class="news_detail"><ul class="faq_answer"><xsl:variable name="news_link" select="concat(./name)" /><h4><a href="{$news_link}"><xsl:value-of disable-output-escaping="yes" select="title" /></a></h4><li><xsl:call-template name="highlight"><xsl:with-param name="text" select="context" /><xsl:with-param name="keywords" select="$keywords" /><xsl:with-param name="class" select="'keyword'" /></xsl:call-template></li></ul></div><xsl:if test="string-length(ls_newsImage)!=0"><div class="detail_img"><img height="62" src="{ls_newsImage}" width="60" /></div></xsl:if><div align="right" class="clear_left back_to_top" style="margin-bottom: 10px;"><span style="float: left;"><xsl:variable name="display-date"><xsl:choose><xsl:when test="string-length(global.Publication_Date)!=0"><xsl:value-of select="global.Publication_Date" /></xsl:when><xsl:otherwise><xsl:value-of select="global.Creation_Date" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:call-template name="format-date-time"><xsl:with-param name="datetime"><xsl:call-template name="format-verity-date-k2"><xsl:with-param name="verity-date" select="$display-date" /></xsl:call-template></xsl:with-param><xsl:with-param name="format-string" select="'mm/dd/yy'" /></xsl:call-template></span><!-- 14Jan,2008, Remedy#INC00000062086, internationalization --><span><a href="#"><script> document.write(document.getElementById('backToTop').innerHTML)  ; </script></a></span></div></li></xsl:for-each></ul></div><!-- BEGIN M19 pagination --><ul class="searchPagination"><xsl:variable name="pagination-links"><xsl:call-template name="pageableLinks"><xsl:with-param name="chunk" select="@chunk" /><xsl:with-param name="lastchunk" select="@lastchunk" /><xsl:with-param name="nextchunk" select="@nextchunk" /><xsl:with-param name="previouschunk" select="@previouschunk" /><xsl:with-param name="chunksize" select="@chunksize" /><xsl:with-param name="search-params" select="../search-params" /></xsl:call-template></xsl:variable><li><span id="paginationPageText"><xsl:text>Page </xsl:text></span><span class="keyword"><xsl:value-of select="@chunk" /></span><span id="paginationOfText"><xsl:text> of </xsl:text></span><span class="keyword"><xsl:value-of select="@lastchunk" /></span><xsl:if test="string-length($pagination-links)!=0"><xsl:text>:</xsl:text></xsl:if></li><xsl:copy-of select="$pagination-links" /></ul><!-- END M19 pagination --></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: news-latest
    Description: Display latest news for M35 module.
========================================================================== --><xsl:template match="news-latest"><xsl:for-each select="news-latest-results/content"><li><a href="{name}"><xsl:value-of disable-output-escaping="yes" select="title" /></a><p><xsl:value-of select="substring-before(substring-after(news_summary,'&lt;P&gt;'),'&lt;/P&gt;')" /></p><p class="date"><!-- format: "11 Aug 2006" --><xsl:call-template name="format-date-time"><xsl:with-param name="datetime"><xsl:call-template name="format-verity-date-k2"><xsl:with-param name="verity-date" select="global.Publication_Date" /></xsl:call-template></xsl:with-param><xsl:with-param name="format-string" select="'dd mmm yyyy'" /></xsl:call-template></p></li></xsl:for-each></xsl:template><!--
==========================================================================
    Template: format-file-size
 Description: Display file size in the appropriate format
  Parameters:
    <size> - size in Bytes
    <format> - format to be used on size (default: ###,###,###.##)
========================================================================== --><xsl:template name="format-file-size"><xsl:param name="size" /><xsl:param name="format" select="'###,###,###.##'" /><!-- get size in KB, MB, GB --><xsl:variable name="sizeKB" select="$size div 1024" /><xsl:variable name="sizeMB" select="$sizeKB div 1024" /><xsl:variable name="sizeGB" select="$sizeMB div 1024" /><xsl:choose><!-- if size in MBs is greater than or equal to 1024 use GBs --><xsl:when test="number($sizeMB) &gt;= 1024"><xsl:value-of select="format-number($sizeGB, $format)" /><xsl:text> GB</xsl:text></xsl:when><!-- if size in KBs is greater than or equal to 1024 use MBs --><xsl:when test="number($sizeKB) &gt;= 1024"><xsl:value-of select="format-number($sizeMB, $format)" /><xsl:text> MB</xsl:text></xsl:when><!-- if size in Bytes is greater than or equal to 1024 use KBs --><xsl:when test="number($size) &gt;= 1024"><xsl:value-of select="format-number($sizeKB, $format)" /><xsl:text> KB</xsl:text></xsl:when><!-- else use Bytes --><xsl:otherwise><xsl:value-of select="format-number($size, $format)" /><xsl:text> Bytes</xsl:text></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: strip-path
 Description: Returns the filename from a URL path, or # if no path
              is available.
========================================================================== --><xsl:template name="strip-path"><xsl:param name="path" /><xsl:choose><xsl:when test="contains($path, '/')"><xsl:call-template name="strip-path"><xsl:with-param name="path" select="substring-after($path, '/')" /></xsl:call-template></xsl:when><xsl:when test="string-length($path)=0"><xsl:text>#</xsl:text></xsl:when><xsl:otherwise><xsl:value-of select="$path" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
  Stylesheet: form-fields.xsl
	 Company: RedDot Solutions
	 Version: 0.7.6
	  Author: Jack Marczewski [RedDot];Michael Madden [RedDot]
 Description: Display form fields from XML
	  Notice: 
========================================================================== --><xsl:param name="form-fields-attribute" /><xsl:param name="product-search-page" /><!-- set render mode --><!--
==========================================================================
	Template: form-fields
	Description: Display form fields from XML
========================================================================== --><xsl:template match="form-fields"><!-- !!! MAKE SURE TO ADD ANY NEW TEMPLATES BELOW, SO THAT THEY CAN BE MATCHED !!! --><xsl:apply-templates select="form-fields-option" /><xsl:apply-templates select="form-fields-checkbox" /><xsl:apply-templates select="form-fields-checkbox-list" /><xsl:apply-templates select="form-fields-checkbox-list2col" /><xsl:apply-templates select="form-fields-checkbox-div" /><xsl:apply-templates select="h2-product-browser-anchors" /><!-- !!! MAKE SURE TO ADD ANY NEW TEMPLATES ABOVE, SO THAT THEY CAN BE MATCHED !!! --></xsl:template><!--
==========================================================================
	Template: form-fields-option
	Description: Display form fields from XML as option elements
========================================================================== --><xsl:template match="form-fields-option"><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><!-- get class of attribute from parent node --><xsl:variable name="att-class" select="../form-fields-class" /><!-- loop over fields --><xsl:for-each select="field"><xsl:element name="option"><xsl:if test="string-length($att-class)!=0"><xsl:attribute name="class"><xsl:value-of select="$att-class" /></xsl:attribute></xsl:if><xsl:attribute name="value"><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="text()" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- End:code change for artifact No 764247--></xsl:attribute><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="text()" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- End:code change for artifact No 764247--></xsl:element></xsl:for-each></xsl:template><!--
==========================================================================
	Template: form-fields-checkbox
	Description: Display form fields from XML as checkboxes
========================================================================== --><xsl:template match="form-fields-checkbox"><!-- get name of attribute from parent node --><xsl:variable name="att-name" select="../form-fields-attribute" /><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><!-- get class of attribute from parent node --><xsl:variable name="att-class" select="../form-fields-class" /><!-- loop over fields --><xsl:for-each select="field"><!-- format value for id --><!-- start:code change for artifact No 764247--><!--<xsl:variable name="value-id" select="translate(translate(substring(text(),0,string-length(text())-31),' ','_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />--><xsl:variable name="value-id" select="substring(text(),0,string-length(text())-31)" /><!-- End:code change for artifact No 764247--><!-- display checkbox --><input><xsl:attribute name="type">checkbox</xsl:attribute><xsl:if test="string-length($att-class)!=0"><xsl:attribute name="class"><xsl:value-of select="$att-class" /></xsl:attribute></xsl:if><xsl:attribute name="id"><xsl:value-of select="$value-id" /></xsl:attribute><xsl:attribute name="name"><xsl:value-of select="$att-name" /></xsl:attribute><xsl:if test="position() &gt; 1"><xsl:attribute name="class">marginLeft10</xsl:attribute></xsl:if><xsl:attribute name="value"><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="text()" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- End:code change for artifact No 764247--></xsl:attribute></input><label class="marginLeft5" for="{$value-id}"><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="text()" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- End:code change for artifact No 764247--></label></xsl:for-each></xsl:template><!--
==========================================================================
	Template: form-fields-checkbox-list
	Description: Display form fields from XML as checkboxes
========================================================================== --><xsl:template match="form-fields-checkbox-list"><!-- get name of attribute from parent node --><xsl:variable name="att-name" select="../form-fields-attribute" /><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><!-- get class of attribute from parent node --><xsl:variable name="att-class" select="../form-fields-class" /><!-- loop over fields --><xsl:for-each select="field"><!-- format value for id --><!-- start:code change for artifact No 764247--><xsl:variable name="value-id" select="substring(text(),0,string-length(text())-31)" /><!--<xsl:variable name="value-id" select="translate(translate(substring(text(),0,string-length(text())-31),' ','_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />--><!-- end:code change for artifact No 764247--><!-- display checkbox --><li><input><xsl:attribute name="type">checkbox</xsl:attribute><xsl:if test="string-length($att-class)!=0"><xsl:attribute name="class"><xsl:value-of select="$att-class" /></xsl:attribute></xsl:if><xsl:attribute name="id"><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="$value-id" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- end:code change for artifact No 764247--></xsl:attribute><xsl:attribute name="name"><xsl:value-of select="$att-name" /></xsl:attribute><xsl:attribute name="value"><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="text()" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- End:code change for artifact No 764247--></xsl:attribute><xsl:if test="contains($req-values, text())"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input><!--<input test="test" type="checkbox" class="{$att-class}" id="{$value-id}" name="{$att-name}" value="{text()}" />--><label for="{$value-id}"><!-- start:code change for artifact No 764247--><!--<xsl:value-of select="text()" />--><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- end:code change for artifact No 764247--></label></li></xsl:for-each></xsl:template><!--
==========================================================================
	Template: form-fields-checkbox-list2col
	Description: Display form fields from XML as checkboxes in two columns
========================================================================== --><xsl:template match="form-fields-checkbox-list2col"><!-- get name of attribute from parent node --><xsl:variable name="att-name" select="../form-fields-attribute" /><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><!-- get class of attribute from parent node --><xsl:variable name="att-class" select="../form-fields-class" /><!-- get count of fields --><xsl:variable name="field-count" select="count(field)" /><!-- split the fields in order to display as two separate lists --><xsl:variable name="remainder"><xsl:value-of select="$field-count mod 3" /></xsl:variable><xsl:if test="$remainder = '0'"><xsl:variable name="fields-first-half" select=".//field[position() &lt;= ($field-count div 3)]" /><xsl:variable name="fields-second-half" select=".//field[position() &gt; ($field-count div 3)    and  position() &lt;= (2*($field-count div 3))] " /><xsl:variable name="fields-third-half" select=".//field[position() &gt; (2*($field-count div 3))]" /><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-first-half" /><xsl:with-param name="div-id">ColumnOne</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-second-half" /><xsl:with-param name="div-id">ColumnTwo</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-third-half" /><xsl:with-param name="div-id">productBrowseCol</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template></xsl:if><xsl:if test="$remainder = '1' "><xsl:variable name="fields-first-half" select=".//field[position() &lt;= (($field-count div 3) + 1 )]" /><xsl:variable name="fields-second-half" select=".//field[position() &gt; (($field-count div 3)+1)    and  position() &lt;= ((2*($field-count div 3))+2)] " /><xsl:variable name="fields-third-half" select=".//field[position() &gt; ((2*($field-count div 3))+2)]" /><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-first-half" /><xsl:with-param name="div-id">ColumnOne</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-second-half" /><xsl:with-param name="div-id">ColumnTwo</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-third-half" /><xsl:with-param name="div-id">productBrowseCol</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template></xsl:if><xsl:if test="$remainder = '2' "><xsl:variable name="fields-first-half" select=".//field[position() &lt;= (($field-count div 3) + 2 )]" /><xsl:variable name="fields-second-half" select=".//field[position() &gt; (($field-count div 3)+2)    and  position() &lt;= ((2*($field-count div 3))+3)] " /><xsl:variable name="fields-third-half" select=".//field[position() &gt; ((2*($field-count div 3))+3)]" /><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-first-half" /><xsl:with-param name="div-id">ColumnOne</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-second-half" /><xsl:with-param name="div-id">ColumnTwo</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template><xsl:call-template name="form-fields-checkbox-list-column"><xsl:with-param name="fields" select="$fields-third-half" /><xsl:with-param name="div-id">productBrowseCol</xsl:with-param><xsl:with-param name="att-name" select="$att-name" /><xsl:with-param name="req-values" select="$req-values" /><xsl:with-param name="att-class" select="$att-class" /></xsl:call-template></xsl:if></xsl:template><!--
==========================================================================
	Template:form-fields-checkbox-list-column

 Description: Display taxonomy from XML as list of checkboxes (single column sub-set)
			  N2 Product Browser.
========================================================================== --><xsl:template name="form-fields-checkbox-list-column"><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><xsl:param name="fields" /><xsl:param name="div-id" /><xsl:param name="att-name" /><xsl:param name="req-values" /><xsl:param name="att-class" /><xsl:if test="count($fields) &gt; 0"><div id="{$div-id}"><ul><xsl:for-each select="$fields"><xsl:variable name="value-id" select="translate(translate(text(),' ','_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- 15-july-08, remedy#35982, Metadata --><xsl:variable name="value-id-name" select="substring($value-id,0,string-length($value-id)-31)" /><li><input><xsl:attribute name="type">checkbox</xsl:attribute><xsl:if test="string-length($att-class)!=0"><xsl:attribute name="class"><xsl:value-of select="$att-class" /></xsl:attribute></xsl:if><xsl:attribute name="id"><!-- 15-july-08, remedy#35982, Metadata --><xsl:value-of select="$value-id-name" /></xsl:attribute><!-- 12-Aug-2008, Remedy#16083, Taxonomy--><xsl:attribute name="name">Category</xsl:attribute><!-- Remedy#Taxonomy, Following lines are commented 
				<xsl:value-of select="$att-name" />
			  </xsl:attribute> --><xsl:attribute name="value"><!-- 15-july-08, remedy#35982, Metadata --><xsl:value-of select="substring(text(),string-length(text())-31)" /></xsl:attribute><xsl:attribute name="class">layerCheckbox</xsl:attribute><xsl:if test="contains($req-values, text())"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input><!--<input test="test" type="checkbox" class="{$att-class}" id="{$value-id}" name="{$att-name}" value="{text()}" />--><!-- 15-july-08, remedy#35982, Metadata starts--><label for="{$value-id-name}"><xsl:value-of select="substring(text(),0,string-length(text())-31)" /><!-- 15-july-08, remedy#35982, Metadata ends--></label></li></xsl:for-each></ul></div></xsl:if></xsl:template><!--
==========================================================================
	Template: h2-product-browser-anchors
	Description: Display taxonomy from XML as anchors. H2 Product Browser.
========================================================================== --><xsl:template match="h2-product-browser-anchors"><!-- get name of attribute from parent node --><xsl:variable name="att-name" select="../form-fields-attribute" /><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><!-- get class of attribute from parent node --><xsl:variable name="att-class" select="../form-fields-class" /><!-- get count of fields --><xsl:variable name="field-count" select="count(field)" /><!-- split the fields in order to display as two separate lists --><xsl:variable name="fields-first-half" select="//field[position() &lt; ($field-count div 2)]" /><xsl:variable name="fields-second-half" select="//field[position() &gt;= ($field-count div 2)]" /><!-- display each set of fields as list --><xsl:call-template name="h2-product-browser-anchors-list"><xsl:with-param name="fields" select="$fields-first-half" /></xsl:call-template><xsl:call-template name="h2-product-browser-anchors-list"><xsl:with-param name="fields" select="$fields-second-half" /></xsl:call-template></xsl:template><!--
==========================================================================
	Template: h2-product-browser-anchors-list
 Description: Display taxonomy from XML as list of anchors. 
			  H2 Product Browser.
========================================================================== --><xsl:template name="h2-product-browser-anchors-list"><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><xsl:param name="fields" /><xsl:if test="count($fields) &gt; 0"><ul><xsl:for-each select="$fields"><li><a href="{$product-search-page}?Application={text()}"><xsl:value-of select="text()" /></a></li></xsl:for-each></ul></xsl:if></xsl:template><!--
==========================================================================
	Template: form-fields-checkbox-div
	Description: Display taxonomy from XML as checkboxes in div elements.
========================================================================== --><xsl:template match="form-fields-checkbox-div"><!-- get name of attribute from parent node --><xsl:variable name="att-name" select="../form-fields-attribute" /><!-- get attribute values in request --><xsl:variable name="req-values" select="../form-fields-values//text()" /><!-- get class of attribute from parent node --><xsl:variable name="att-class" select="../form-fields-class" /><!-- loop over fields --><xsl:for-each select="field"><!-- format value for id --><xsl:variable name="value-id" select="translate(translate(text(),' ','_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" /><!-- display checkbox --><div style="width:150px; float:left; margin:0; padding:0;"><ul><li style="list-style:none; margin:0; padding:0; display:block; float:left;"><input><xsl:attribute name="type">checkbox</xsl:attribute><xsl:if test="string-length($att-class)!=0"><xsl:attribute name="class"><xsl:value-of select="$att-class" /></xsl:attribute></xsl:if><xsl:attribute name="id"><xsl:value-of select="$value-id" /></xsl:attribute><xsl:attribute name="name"><xsl:value-of select="$att-name" /></xsl:attribute><xsl:attribute name="value"><xsl:value-of select="text()" /></xsl:attribute></input><!--<input test="test" type="checkbox" class="{$att-class}" id="{$value-id}" name="{$att-name}" value="{text()}" />--></li><li style="list-style:none; margin:0; padding:0; display:block; float:left;"><label for="{$value-id}"><xsl:value-of select="text()" /></label></li></ul></div><!-- clear float for every even count --><xsl:if test="number(position() mod 2) = 0"><div class="clear" /></xsl:if></xsl:for-each></xsl:template><!-- ========================================================================== --><!-- these are 'string arrays' - change for language requirements               --><xsl:variable name="default-week-day-names" select="'[1]Monday[2]Tuesday[3]Wednesday[4]Thursday[5]Friday[6]Saturday[7]Sunday[end]'" /><xsl:variable name="default-month-names" select="'[01]January[02]February[03]March[04]April[05]May[06]June[07]July[08]August[09]September[10]October[11]November[12]December[end]'" /><xsl:variable name="default-month-names-abbr" select="'[01]Jan[02]Feb[03]Mar[04]Apr[05]May[06]Jun[07]Jul[08]Aug[09]Sep[10]Oct[11]Nov[12]Dec[end]'" /><xsl:variable name="default-am-pm-names" select="'[0]am[1]pm[end]'" /><!-- ========================================================================== --><!-- ========================================================================== --><!-- these are entity variables. Used so not to break XSL code                  --><xsl:variable name="entity-quot"><xsl:text>"</xsl:text></xsl:variable><xsl:variable name="entity-apos"><xsl:text>'</xsl:text></xsl:variable><!-- ========================================================================== --><!--
==========================================================================
    Template: date-to-julian-day
 Description: Convert a date to julian day
 Parameters:-
    <year> <month> <day>
   or
    <date> (format: yyyymmdd or yyyy-mm-dd)
========================================================================== --><xsl:template name="date-to-julian-day"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><!-- or --><xsl:param name="date" select="''" /><!-- trim down date --><xsl:variable name="tdate" select="translate($date,'-','')" /><!-- decide which params were passed --><xsl:variable name="yyyy"><xsl:choose><xsl:when test="string-length($date) &gt; 0"><xsl:value-of select="substring($tdate,1,4)" /></xsl:when><xsl:otherwise><xsl:value-of select="$year" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="mm"><xsl:choose><xsl:when test="string-length($date) &gt; 0"><xsl:value-of select="substring($tdate,5,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$month" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="dd"><xsl:choose><xsl:when test="string-length($date) &gt; 0"><xsl:value-of select="substring($tdate,7,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$day" /></xsl:otherwise></xsl:choose></xsl:variable><!-- pre-calcs --><xsl:variable name="j0" select="ceiling(($mm - 14) div 12)" /><xsl:variable name="j1" select="floor((1461 * ($yyyy + 4800 + $j0)) div 4)" /><xsl:variable name="j2" select="floor((367 * ($mm - 2 - (12 * $j0))) div 12)" /><xsl:variable name="j3" select="floor((3 * floor(($yyyy + 4900 + $j0) div 100)) div 4)" /><!-- final calc --><xsl:value-of select="$j1 + $j2 - $j3 + $dd - 32075" /></xsl:template><!--
==========================================================================
    Template: julian-day-to-date
 Description: Convert a julian day to date
 Parameters:-
    <julian-day>
========================================================================== --><xsl:template name="julian-day-to-date"><xsl:param name="julian-day" select="number(0)" /><!-- pre-calcs --><xsl:variable name="la" select="$julian-day + 68569" /><xsl:variable name="n" select="floor((4 * $la) div 146097)" /><xsl:variable name="lb" select="$la - floor((146097 * $n + 3) div 4)" /><xsl:variable name="i" select="floor((4000 * ($lb + 1)) div 1461001)" /><xsl:variable name="lc" select="$lb - floor((1461 * $i) div 4) + 31" /><xsl:variable name="j" select="floor((80 * $lc) div 2447)" /><xsl:variable name="day" select="$lc - floor((2447 * $j) div 80)" /><xsl:variable name="ld" select="floor($j div 11)" /><xsl:variable name="month" select="$j + 2 - (12 * $ld)" /><xsl:variable name="year" select="100 * ($n - 49) + $i + $ld" /><!-- pad final result --><xsl:variable name="sday" select="concat(substring('00',1,2 - string-length(string($day))),string($day))" /><xsl:variable name="smonth" select="concat(substring('00',1,2 - string-length(string($month))),string($month))" /><xsl:variable name="syear" select="concat(substring('00',1,4 - string-length(string($year))),string($year))" /><!-- final output --><xsl:value-of select="concat($syear,'-',$smonth,'-',$sday)" /></xsl:template><!--
==========================================================================
    Template: date-diff
 Description: Calculate the difference (in days) between two dates
 Parameters:-
    <year1> <month1> <day1>
   or
    <date1>

   and
    <year2> <month2> <day2>
   or
    <date2>
========================================================================== --><xsl:template name="date-diff"><xsl:param name="year1" /><xsl:param name="month1" /><xsl:param name="day1" /><xsl:param name="year2" /><xsl:param name="month2" /><xsl:param name="day2" /><!-- or --><xsl:param name="date1" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><xsl:param name="date2" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><!-- calc the two julian day numbers --><xsl:variable name="jd1"><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$year1" /><xsl:with-param name="month" select="$month1" /><xsl:with-param name="day" select="$day1" /><xsl:with-param name="date" select="$date1" /></xsl:call-template></xsl:variable><xsl:variable name="jd2"><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$year2" /><xsl:with-param name="month" select="$month2" /><xsl:with-param name="day" select="$day2" /><xsl:with-param name="date" select="$date2" /></xsl:call-template></xsl:variable><!-- perform calc --><xsl:value-of select="$jd1 - $jd2" /></xsl:template><!--
==========================================================================
    Template: date-add
 Description: Adds/subtracts a specified number of days to a date
 Parameters:-
    <year> <month> <day>
   or
    <date>

   and
    <add> (+ve or -ve)
========================================================================== --><xsl:template name="date-add"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><!-- or --><xsl:param name="date" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><!-- and add/subtract days --><xsl:param name="add" select="number(0)" /><!-- get the julian day for the date --><xsl:variable name="jd"><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$year" /><xsl:with-param name="month" select="$month" /><xsl:with-param name="day" select="$day" /><xsl:with-param name="date" select="$date" /></xsl:call-template></xsl:variable><!-- add/subtract the modifier to the julian day --><xsl:variable name="output-date"><xsl:call-template name="julian-day-to-date"><xsl:with-param name="julian-day" select="$jd + $add" /></xsl:call-template></xsl:variable><!-- output resultant --><xsl:value-of select="$output-date" /></xsl:template><!--
==========================================================================
    Template: date-time-to-float
 Description: Convert a date/time to a floating point.  The date portion is
              returned as the integer part of the number (as julian day)
              and the time portion is represent as fractional of a day.
              (This number is useful for adding times to dates)
 Parameters:-
    <year> <month> <day> <hour> <minute> <second>
   or
    <datetime>
========================================================================== --><xsl:template name="date-time-to-float"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><xsl:param name="hour" /><xsl:param name="minute" /><xsl:param name="second" /><!-- or --><xsl:param name="datetime" select="''" /><!-- format: yyyymmddThhmmss or yyyy-mm-ddThh:mm:ss --><!-- trim down date and pad with midnight --><xsl:variable name="tdatetime" select="concat(translate($datetime,'-T:',''),'000000')" /><!-- decide which params were passed --><xsl:variable name="yyyy"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:value-of select="substring($tdatetime,1,4)" /></xsl:when><xsl:otherwise><xsl:value-of select="$year" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="mm"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:value-of select="substring($tdatetime,5,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$month" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="dd"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:value-of select="substring($tdatetime,7,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$day" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="hh"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:value-of select="substring($tdatetime,9,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$hour" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="nn"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:value-of select="substring($tdatetime,11,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$minute" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="ss"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:value-of select="substring($tdatetime,13,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$second" /></xsl:otherwise></xsl:choose></xsl:variable><!-- calculate integer part (date) as julian day --><xsl:variable name="jd"><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$yyyy" /><xsl:with-param name="month" select="$mm" /><xsl:with-param name="day" select="$dd" /></xsl:call-template></xsl:variable><xsl:value-of select="number($jd) + ($hh * (1 div 24)) + ($nn * (1 div 1440)) + ($ss * (1 div 86400))" /></xsl:template><!--
==========================================================================
    Template: time-to-float
 Description: Convert a time to a floating point.  The time is returned
              as a fractional part of a day (e.g. 12 noon = 0.5).
              This is useful for adding specified hour differentials
              (such as time zones) to floating point representations of
              date/times.
 Parameters:-
    <hour> <minute> <second>
   or
    <time>
========================================================================== --><xsl:template name="time-to-float"><xsl:param name="hour" /><xsl:param name="minute" /><xsl:param name="second" /><!-- or --><xsl:param name="time" select="''" /><!-- format: hhmmss or hh:mm:ss --><!-- trim down time by removing ':' chars --><xsl:variable name="ttime" select="translate($time,':','')" /><!-- decide which params were passed --><xsl:variable name="hh"><xsl:choose><xsl:when test="string-length($time) &gt; 0"><xsl:value-of select="substring($ttime,1,2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$hour" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="nn"><xsl:choose><xsl:when test="string-length($time) &gt; 0"><xsl:value-of select="concat('0',substring($ttime,3,2))" /></xsl:when><xsl:otherwise><xsl:value-of select="concat('0',$minute)" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="ss"><xsl:choose><xsl:when test="string-length($time) &gt; 0"><xsl:value-of select="concat('0',substring($ttime,5,2))" /></xsl:when><xsl:otherwise><xsl:value-of select="concat('0',$second)" /></xsl:otherwise></xsl:choose></xsl:variable><!-- final resultant --><xsl:value-of select="($hh * (1 div 24)) + ($nn * (1 div 1440)) + ($ss * (1 div 86400))" /></xsl:template><!-- 
==========================================================================
    Template: float-to-date-time
 Description: Convert a floating point value representing a date/time to
              a date/time string.
 Parameters:-
    <value>  the value to be converted
    <round-seconds>  if true then the seconds are not quoted on the output
                     and, if the seconds are 59 then hour/minute is rounded
                     (this is useful because some processors have limited
                      floating point precision to cope with the seconds)
========================================================================== --><xsl:template name="float-to-date-time"><xsl:param name="value" select="number(0)" /><xsl:param name="round-seconds" select="false()" /><xsl:variable name="date"><xsl:call-template name="julian-day-to-date"><xsl:with-param name="julian-day" select="floor($value)" /></xsl:call-template></xsl:variable><xsl:variable name="t1" select="$value - floor($value)" /><xsl:variable name="h" select="floor($t1 div (1 div 24))" /><xsl:variable name="t2" select="$t1 - ($h * (1 div 24))" /><xsl:variable name="m" select="floor($t2 div (1 div 1440))" /><xsl:variable name="t3" select="$t2 - ($m * (1 div 1440))" /><xsl:choose><xsl:when test="$round-seconds"><xsl:variable name="s" select="$t3 div (1 div 86400)" /><xsl:variable name="h2"><xsl:choose><xsl:when test="($s &gt;= 59) and ($m = 59)"><xsl:value-of select="$h + 1" /></xsl:when><xsl:otherwise><xsl:value-of select="$h" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="m2"><xsl:choose><xsl:when test="($s &gt;= 59) and ($m = 59)">0</xsl:when><xsl:when test="($s &gt;= 59)"><xsl:value-of select="$m + 1" /></xsl:when><xsl:otherwise><xsl:value-of select="$m" /></xsl:otherwise></xsl:choose></xsl:variable><!-- pad final time result --><xsl:variable name="hh" select="concat(substring('00',1,2 - string-length(string($h2))),string($h2))" /><xsl:variable name="mm" select="concat(substring('00',1,2 - string-length(string($m2))),string($m2))" /><!-- final output resultant --><xsl:value-of select="concat($date,'T',$hh,':',$mm)" /></xsl:when><xsl:otherwise><xsl:variable name="s" select="floor($t3 div (1 div 86400))" /><!-- pad final time result --><xsl:variable name="hh" select="concat(substring('00',1,2 - string-length(string($h))),string($h))" /><xsl:variable name="mm" select="concat(substring('00',1,2 - string-length(string($m))),string($m))" /><xsl:variable name="ss" select="concat(substring('00',1,2 - string-length(string($s))),string($s))" /><!-- final output resultant --><xsl:value-of select="concat($date,'T',$hh,':',$mm,':',$ss)" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: week-number
 Description: Calculates the week number of a date.
              Week numbers are calculated according to ISO8601 - where week
              number 1 is the week that contains the 4th Jan.
              A week, according to ISO8601, starts on a Monday.
 Parameters:-
    <year> <month> <day>
   or
    <date>
   or
    <julian-day>
========================================================================== --><xsl:template name="week-number"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><!-- or --><xsl:param name="date" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><!-- or --><xsl:param name="julian-day" select="''" /><!-- trim down date --><xsl:variable name="tdate" select="translate($date,'-','')" /><!-- decide which params were passed --><xsl:variable name="yyyy"><xsl:choose><xsl:when test="string-length($date) &gt; 0"><xsl:value-of select="substring($tdate,1,4)" /></xsl:when><xsl:when test="string-length($julian-day) &gt; 0"><xsl:variable name="jdate"><xsl:call-template name="julian-day-to-date"><xsl:with-param name="julian-day" select="$julian-day" /></xsl:call-template></xsl:variable><xsl:value-of select="substring($jdate,1,4)" /></xsl:when><xsl:otherwise><xsl:value-of select="$year" /></xsl:otherwise></xsl:choose></xsl:variable><!-- get the julian day number --><xsl:variable name="jd"><xsl:choose><xsl:when test="string-length($julian-day) &gt; 0"><xsl:value-of select="$julian-day" /></xsl:when><xsl:otherwise><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$year" /><xsl:with-param name="month" select="$month" /><xsl:with-param name="day" select="$day" /><xsl:with-param name="date" select="$date" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:variable><!-- get the julian day number for the first working day of next year --><xsl:variable name="fyjd"><xsl:call-template name="first-day-of-year"><xsl:with-param name="year" select="$yyyy+1" /><xsl:with-param name="as-julian-day" select="true()" /></xsl:call-template></xsl:variable><!-- decide which the 'working' year for this date is --><xsl:variable name="start-jd"><xsl:choose><xsl:when test="$jd &gt;= $fyjd"><xsl:value-of select="$fyjd" /></xsl:when><xsl:otherwise><xsl:call-template name="date-to-julian-day"><xsl:with-param name="date"><xsl:call-template name="first-day-of-year"><xsl:with-param name="year" select="$yyyy" /></xsl:call-template></xsl:with-param></xsl:call-template></xsl:otherwise></xsl:choose></xsl:variable><!-- final calc output --><xsl:value-of select="floor(($jd - $start-jd) div 7) + 1" /></xsl:template><!--
==========================================================================
    Template: week-number-to-date
 Description: Calculates the date of the Monday of the given week number in
              the specified year.
              Week numbers are calculated according to ISO8601 - where week
              number 1 is the week that contains the 4th Jan.
              A week, according to ISO8601, starts on a Monday.
 Parameters:-
    <week> <year>
    [<as-julian-day>]
========================================================================== --><xsl:template name="week-number-to-date"><xsl:param name="week" select="number(1)" /><xsl:param name="year" select="number(1)" /><!-- return date as julian day --><xsl:param name="as-julian-day" select="false()" /><!-- calc first working day of year --><xsl:variable name="fwdy"><xsl:call-template name="first-day-of-year"><xsl:with-param name="year" select="$year" /><xsl:with-param name="as-julian-day" select="true()" /></xsl:call-template></xsl:variable><xsl:variable name="wntd" select="$fwdy + (($week - 1) * 7)" /><xsl:choose><xsl:when test="$as-julian-day"><xsl:value-of select="$wntd" /></xsl:when><xsl:otherwise><xsl:call-template name="julian-day-to-date"><xsl:with-param name="julian-day" select="$wntd" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: working-year
 Description: Calculates the working year of a given date.
              A date may actually appear as a working day of the previous
              year - as specified by the week calculations according to
              ISO8601 (where week number 1 begins the week containing the
              4th Jan).
 Parameters:-
    <year> <month> <day>
   or
    <date>
   or
    <julian-day>
========================================================================== --><xsl:template name="working-year"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><!-- or --><xsl:param name="date" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><!-- or --><xsl:param name="julian-day" select="''" /><!-- trim down date --><xsl:variable name="tdate" select="translate($date,'-','')" /><!-- decide which params were passed --><xsl:variable name="yyyy"><xsl:choose><xsl:when test="string-length($date) &gt; 0"><xsl:value-of select="substring($tdate,1,4)" /></xsl:when><xsl:when test="string-length($julian-day) &gt; 0"><xsl:variable name="jdate"><xsl:call-template name="julian-day-to-date"><xsl:with-param name="julian-day" select="$julian-day" /></xsl:call-template></xsl:variable><xsl:value-of select="substring($jdate,1,4)" /></xsl:when><xsl:otherwise><xsl:value-of select="$year" /></xsl:otherwise></xsl:choose></xsl:variable><!-- get the julian day number --><xsl:variable name="jd"><xsl:choose><xsl:when test="string-length($julian-day) &gt; 0"><xsl:value-of select="$julian-day" /></xsl:when><xsl:otherwise><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$year" /><xsl:with-param name="month" select="$month" /><xsl:with-param name="day" select="$day" /><xsl:with-param name="date" select="$date" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:variable><!-- get the julian day number for the first working day of next year --><xsl:variable name="fyjd"><xsl:call-template name="first-day-of-year"><xsl:with-param name="year" select="$yyyy+1" /><xsl:with-param name="as-julian-day" select="true()" /></xsl:call-template></xsl:variable><!-- decide which the 'working' year for this date is --><xsl:choose><xsl:when test="$jd &gt;= $fyjd"><xsl:value-of select="$yyyy+1" /></xsl:when><xsl:otherwise><xsl:value-of select="$yyyy" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: weeks-in-year
 Description: Calculates the number of weeks in a year according to the
              ISO8601 standard for weeks.
 Parameters:-
    <year>
========================================================================== --><xsl:template name="weeks-in-year"><xsl:param name="year" select="number(0)" /><xsl:variable name="syear" select="concat(substring('0000',1,4 - string-length($year)),$year)" /><!-- last week in year is always the week that contains 28th December --><xsl:call-template name="week-number"><xsl:with-param name="date" select="concat($syear,'1228')" /></xsl:call-template></xsl:template><!--
==========================================================================
    Template: first-day-of-year
 Description: Calculates the first working day of the year (Monday)
              according to ISO8601 where week 1 of a year is the week that
              contains the 4th Jan.
 Parameters:-
    <year>
    [<as-julian-day>]
========================================================================== --><xsl:template name="first-day-of-year"><xsl:param name="year" /><xsl:param name="as-julian-day" select="false()" /><xsl:variable name="syear" select="concat(substring('0000',1,4 - string-length($year)),$year)" /><!-- week 1 is the week containing 4th Jan --><xsl:variable name="jan4-jd"><xsl:call-template name="date-to-julian-day"><xsl:with-param name="date" select="concat($syear,'0104')" /></xsl:call-template></xsl:variable><!-- get the week day for the 4th Jan --><xsl:variable name="jan4-wd"><xsl:call-template name="day-of-week"><xsl:with-param name="date" select="concat($syear,'0104')" /></xsl:call-template></xsl:variable><!-- first day is the prev monday --><xsl:choose><xsl:when test="$as-julian-day"><xsl:value-of select="$jan4-jd - ($jan4-wd - 1)" /></xsl:when><xsl:otherwise><xsl:call-template name="julian-day-to-date"><xsl:with-param name="julian-day" select="$jan4-jd - ($jan4-wd - 1)" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: day-of-week
 Description: Calculates the day of the week for a date - where the first
              day of the week is Monday (1) and the last day of the week is
              is Sunday (7) - according to ISO8601.
 Parameters:-
    <year> <month> <day>
   or
    <date>
   or
    <julian-day>
========================================================================== --><xsl:template name="day-of-week"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><!-- or --><xsl:param name="date" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><!-- or --><xsl:param name="julian-day" select="''" /><!-- get julian day --><xsl:variable name="jd"><xsl:choose><xsl:when test="string-length($julian-day) &gt; 0"><xsl:value-of select="$julian-day" /></xsl:when><xsl:otherwise><xsl:call-template name="date-to-julian-day"><xsl:with-param name="year" select="$year" /><xsl:with-param name="month" select="$month" /><xsl:with-param name="day" select="$day" /><xsl:with-param name="date" select="$date" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:variable><!-- pre-calcs --><xsl:variable name="dw0" select="$jd mod 10227" /><xsl:value-of select="($dw0 mod 7) + 1" /></xsl:template><!--
==========================================================================
    Template: named-day-of-week
 Description: Calculates the day of the week for a date - where the first
              day of the week is Monday (1) and the last day of the week is
              is Sunday (7) - according to ISO8601.
              The day of week is returned as its name.
 Parameters:-
    <year> <month> <day>
   or
    <date>
   or
    <julian-day>
   optional override parameter:-
   [<week-day-names>]
========================================================================== --><xsl:template name="named-day-of-week"><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><!-- or --><xsl:param name="date" select="''" /><!-- format: yyyymmdd or yyyy-mm-dd --><!-- or --><xsl:param name="julian-day" select="''" /><!-- override week day names parameter --><xsl:param name="week-day-names" select="$default-week-day-names" /><!-- get numeric day of week --><xsl:variable name="dwn"><xsl:text>[</xsl:text><xsl:call-template name="day-of-week"><xsl:with-param name="year" select="$year" /><xsl:with-param name="month" select="$month" /><xsl:with-param name="day" select="$day" /><xsl:with-param name="date" select="$date" /><xsl:with-param name="julian-day" select="$julian-day" /></xsl:call-template><xsl:text>]</xsl:text></xsl:variable><xsl:value-of select="substring-before(substring($week-day-names,string-length(substring-before($week-day-names,$dwn)) + 4),'[')" /></xsl:template><!--
==========================================================================
    Template: format-verity-date
 Description: formats verity date output field.
              in: dd-mmm-yyyy hh:mm:ss pm
              out: yyyymmddThhmmss
 Parameters:-
    <verity-date>
========================================================================== --><xsl:template name="format-verity-date"><xsl:param name="verity-date" /><xsl:param name="month-names" select="$default-month-names" /><!-- get day --><xsl:variable name="day" select="substring($verity-date, 1, 2)" /><!-- get month as numeric --><xsl:variable name="month" select="substring($month-names, string-length(substring-before($month-names, substring($verity-date, 4, 3))) - 2, 2)" /><!-- get year --><xsl:variable name="year" select="substring($verity-date, 8, 4)" /><!-- get hour --><xsl:variable name="hour12" select="number(substring($verity-date, 13, 2))" /><!-- get am/pm --><xsl:variable name="apm" select="substring($verity-date, 22, 2)" /><!-- set as 24 hr --><xsl:variable name="hour"><xsl:choose><xsl:when test="$apm = 'pm'"><xsl:value-of select="$hour12 + 12" /></xsl:when><xsl:otherwise><xsl:value-of select="$hour12" /></xsl:otherwise></xsl:choose></xsl:variable><!-- get minutes --><xsl:variable name="minutes" select="substring($verity-date, 16, 2)" /><!-- get seconds --><xsl:variable name="seconds" select="substring($verity-date, 19, 2)" /><!-- output formatted date --><xsl:value-of select="concat($year,$month,$day,'T',$hour,$minutes,$seconds,$apm)" /></xsl:template><!--
==========================================================================
    Template: format-verity-date-k2
 Description: formats verity date output field.
              in: dd-mmm-yyyy hh:nn:ss pm
              in: yyyy/mm/dd hh:nn:ss
              out: yyyy-mm-ddThh:nn:ss
 Parameters:-
    <verity-date>
========================================================================== --><xsl:template name="format-verity-date-k2"><xsl:param name="verity-date" /><!-- replace "/" with "-" --><xsl:variable name="date1" select="translate($verity-date, '/', '-')" /><!-- replace space with "T" --><xsl:variable name="date2" select="translate($date1, ' ', 'T')" /><!-- output formatted date --><xsl:value-of select="$date2" /></xsl:template><!--
==========================================================================
    Template: format-date-time
 Description: Formats a given date/time according to a format string.
 Parameters:-
   <format-string>

    <year> <month> <day> <hour> <minute> <second>
   or
    <datetime>
   or
    <julian-day>
   optional override parameters:-
   [<week-day-names>]
   [<month-names>]
   [<am-pm-names>]

 Format string tokens:-
   yyyy    : Year (4-digit)
   yy      : Year (2-digit)
   mmmm    : Month name (full)
   mmm     : Month name (abbreviated to 3 chars)
   mm      : Month (padded with zero to two digits)
   m       : Month (1 ro 2 digits)
   dd      : Day (padded with zero to teo digits)
   d       : Day (1 or 2 digits)
   th      : nth day modifier (e.g. st, nd, rd, th)
   dowwww  : Day of week (full - e.g Monday, Tuesday etc.)
   dowww   : Day of week (abbreviated to 3 chars - e.g. Mon, Tue etc.)
   dow     : Day of week (numeric: 1=Monday)
   wyyyy   : Working year (4-digit)
   wyy     : Working year (2-digit)
   wnn     : Week number (padded with zero to two digits)
   wn      : Week number (1 or 2 digits)
   hm      : Hour (reduced to 12-hour clock - 1 or 2 digits)
   hh      : Hour (24-hour clock - padded with zero to two digits)
   h       : Hour (1 or 2 digits)
   nn      : Minute (padded with zero to two digits)
   n       : Minute (1 or 2 digits)
   ss      : Second (padded with zero to two digits)
   s       : Second (1 or 2 digits)
   apm     : am/pm marker
   'x...x' : Literal string
   "x...x" : Literal string
========================================================================== --><xsl:template name="format-date-time"><!-- required format --><xsl:param name="format-string">yyyy-mm-dd<xsl:value-of select="$entity-apos" />T<xsl:value-of select="$entity-apos" />hh:nn:ss</xsl:param><!-- passed date/time --><xsl:param name="year" /><xsl:param name="month" /><xsl:param name="day" /><xsl:param name="hour" /><xsl:param name="minute" /><xsl:param name="second" /><!-- or --><xsl:param name="datetime" select="''" /><!-- format: yyyymmddThhmmss or yyyy-mm-ddThh:mm:ss --><!-- or --><xsl:param name="julian-day" select="''" /><!-- this can be float type to include times --><!-- default week day, month and am/pm names overrides --><xsl:param name="week-day-names" select="$default-week-day-names" /><xsl:param name="month-names" select="$default-month-names" /><xsl:param name="am-pm-names" select="$default-am-pm-names" /><!-- convert date passed to common format --><xsl:variable name="use-datetime"><xsl:choose><xsl:when test="string-length($datetime) &gt; 0"><xsl:variable name="tdate" select="translate($datetime,'-:T','')" /><xsl:value-of select="concat($tdate,substring('00000000000000',1,14 - string-length($tdate)))" /></xsl:when><xsl:when test="string-length($julian-day) &gt; 0"><xsl:variable name="tdate"><xsl:call-template name="float-to-date-time"><xsl:with-param name="value" select="$julian-day" /></xsl:call-template></xsl:variable><xsl:value-of select="translate($tdate,'-:T','')" /></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring('0000',1,4 - string-length($year)),$year)" /><xsl:value-of select="concat(substring('00',1,2 - string-length($month)),$month)" /><xsl:value-of select="concat(substring('00',1,2 - string-length($day)),$day)" /><xsl:value-of select="concat(substring('00',1,2 - string-length($hour)),$hour)" /><xsl:value-of select="concat(substring('00',1,2 - string-length($minute)),$minute)" /><xsl:value-of select="concat(substring('00',1,2 - string-length($second)),$second)" /></xsl:otherwise></xsl:choose></xsl:variable><xsl:call-template name="format-date-time-tokenizer"><xsl:with-param name="fmt" select="$format-string" /><xsl:with-param name="datetime" select="$use-datetime" /><xsl:with-param name="week-day-names" select="$week-day-names" /><xsl:with-param name="month-names" select="$month-names" /><xsl:with-param name="am-pm-names" select="$am-pm-names" /></xsl:call-template></xsl:template><xsl:template name="format-date-time-tokenizer"><xsl:param name="fmt">yyyy-mm-dd<xsl:value-of select="$entity-apos" />T<xsl:value-of select="$entity-apos" />hh:nn:ss</xsl:param><xsl:param name="datetime" /><xsl:param name="week-day-names" select="$default-week-day-names" /><xsl:param name="month-names" select="$default-month-names" /><xsl:param name="am-pm-names" select="$default-am-pm-names" /><xsl:if test="string-length($fmt) &gt; 0"><xsl:variable name="token"><xsl:choose><xsl:when test="substring($fmt,1,4) = 'yyyy'"><xsl:text>yyyy</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'yy'"><xsl:text>yy</xsl:text></xsl:when><xsl:when test="substring($fmt,1,4) = 'mmmm'"><xsl:text>mmmm</xsl:text></xsl:when><xsl:when test="substring($fmt,1,3) = 'mmm'"><xsl:text>mmm</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'mm'"><xsl:text>mm</xsl:text></xsl:when><xsl:when test="substring($fmt,1,1) = 'm'"><xsl:text>m</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'th'"><xsl:text>th</xsl:text></xsl:when><xsl:when test="substring($fmt,1,6) = 'dowwww'"><xsl:text>dowwww</xsl:text></xsl:when><xsl:when test="substring($fmt,1,5) = 'dowww'"><xsl:text>dowww</xsl:text></xsl:when><xsl:when test="substring($fmt,1,3) = 'dow'"><xsl:text>dow</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'dd'"><xsl:text>dd</xsl:text></xsl:when><xsl:when test="substring($fmt,1,1) = 'd'"><xsl:text>d</xsl:text></xsl:when><xsl:when test="substring($fmt,1,5) = 'wyyyy'"><xsl:text>wyyyy</xsl:text></xsl:when><xsl:when test="substring($fmt,1,3) = 'wyy'"><xsl:text>wyy</xsl:text></xsl:when><xsl:when test="substring($fmt,1,3) = 'wnn'"><xsl:text>wnn</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'wn'"><xsl:text>wn</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'hm'"><xsl:text>hm</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'hh'"><xsl:text>hh</xsl:text></xsl:when><xsl:when test="substring($fmt,1,1) = 'h'"><xsl:text>h</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'nn'"><xsl:text>nn</xsl:text></xsl:when><xsl:when test="substring($fmt,1,1) = 'n'"><xsl:text>n</xsl:text></xsl:when><xsl:when test="substring($fmt,1,2) = 'ss'"><xsl:text>ss</xsl:text></xsl:when><xsl:when test="substring($fmt,1,1) = 's'"><xsl:text>s</xsl:text></xsl:when><xsl:when test="substring($fmt,1,3) = 'apm'"><xsl:text>apm</xsl:text></xsl:when><xsl:when test="string-length(translate(substring($fmt,1,1),$entity-apos,'')) = 0"><xsl:variable name="rn" select="string-length(substring-before(substring($fmt,2),$entity-apos))" /><xsl:value-of select="substring($fmt,1,$rn+2)" /></xsl:when><xsl:when test="string-length(translate(substring($fmt,1,1),$entity-quot,'')) = 0"><xsl:variable name="rn" select="string-length(substring-before(substring($fmt,2),$entity-quot))" /><xsl:value-of select="substring($fmt,1,$rn+2)" /></xsl:when><xsl:otherwise><xsl:value-of select="substring($fmt,1,1)" /></xsl:otherwise></xsl:choose></xsl:variable><!-- handle the token --><xsl:call-template name="format-date-time-tokens"><xsl:with-param name="token" select="$token" /><xsl:with-param name="datetime" select="$datetime" /><xsl:with-param name="week-day-names" select="$week-day-names" /><xsl:with-param name="month-names" select="$month-names" /><xsl:with-param name="am-pm-names" select="$am-pm-names" /></xsl:call-template><!-- recurse into self to handle rest of format string --><xsl:call-template name="format-date-time-tokenizer"><xsl:with-param name="fmt" select="substring($fmt,string-length($token) + 1)" /><xsl:with-param name="datetime" select="$datetime" /><xsl:with-param name="week-day-names" select="$week-day-names" /><xsl:with-param name="month-names" select="$month-names" /><xsl:with-param name="am-pm-names" select="$am-pm-names" /></xsl:call-template></xsl:if></xsl:template><xsl:template name="format-date-time-tokens"><xsl:param name="token" /><xsl:param name="datetime" /><xsl:param name="week-day-names" /><xsl:param name="month-names" /><xsl:param name="am-pm-names" /><xsl:choose><xsl:when test="$token = 'yyyy'"><xsl:value-of select="substring($datetime,1,4)" /></xsl:when><xsl:when test="$token = 'yy'"><xsl:value-of select="substring($datetime,3,2)" /></xsl:when><xsl:when test="$token = 'mmmm'"><xsl:variable name="mn" select="concat('[',substring($datetime,5,2),']')" /><xsl:value-of select="substring-before(substring($month-names,string-length(substring-before($month-names,$mn)) + 5),'[')" /></xsl:when><xsl:when test="$token = 'mmm'"><xsl:variable name="mn" select="concat('[',substring($datetime,5,2),']')" /><xsl:value-of select="substring(substring-before(substring($month-names,string-length(substring-before($month-names,$mn)) + 5),'['),1,3)" /></xsl:when><xsl:when test="$token = 'mm'"><xsl:value-of select="substring($datetime,5,2)" /></xsl:when><xsl:when test="$token = 'm'"><xsl:value-of select="number(substring($datetime,5,2))" /></xsl:when><xsl:when test="$token = 'th'"><xsl:choose><xsl:when test="substring($datetime,8,1) = '0' or substring($datetime,7,1) = '1'"><xsl:text>th</xsl:text></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="substring($datetime,8,1) = '1'"><xsl:text>st</xsl:text></xsl:when><xsl:when test="substring($datetime,8,1) = '2'"><xsl:text>nd</xsl:text></xsl:when><xsl:when test="substring($datetime,8,1) = '3'"><xsl:text>rd</xsl:text></xsl:when><xsl:otherwise><xsl:text>th</xsl:text></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$token = 'dd'"><xsl:value-of select="substring($datetime,7,2)" /></xsl:when><xsl:when test="$token = 'd'"><xsl:value-of select="number(substring($datetime,7,2))" /></xsl:when><xsl:when test="$token = 'dowwww'"><xsl:call-template name="named-day-of-week"><xsl:with-param name="date" select="substring($datetime,1,8)" /><xsl:with-param name="week-day-names" select="$week-day-names" /></xsl:call-template></xsl:when><xsl:when test="$token = 'dowww'"><xsl:variable name="dow"><xsl:call-template name="named-day-of-week"><xsl:with-param name="date" select="substring($datetime,1,8)" /><xsl:with-param name="week-day-names" select="$week-day-names" /></xsl:call-template></xsl:variable><xsl:value-of select="substring($dow,1,3)" /></xsl:when><xsl:when test="$token = 'dow'"><xsl:call-template name="day-of-week"><xsl:with-param name="date" select="substring($datetime,1,8)" /></xsl:call-template></xsl:when><xsl:when test="$token = 'wyyyy'"><xsl:call-template name="working-year"><xsl:with-param name="date" select="substring($datetime,1,8)" /></xsl:call-template></xsl:when><xsl:when test="$token = 'wyy'"><xsl:variable name="wyy"><xsl:call-template name="working-year"><xsl:with-param name="date" select="substring($datetime,1,8)" /></xsl:call-template></xsl:variable><xsl:value-of select="substring($wyy,3,2)" /></xsl:when><xsl:when test="$token = 'wnn'"><xsl:variable name="wn"><xsl:call-template name="week-number"><xsl:with-param name="date" select="substring($datetime,1,8)" /></xsl:call-template></xsl:variable><xsl:value-of select="concat(substring('00',1,2 - string-length($wn)),$wn)" /></xsl:when><xsl:when test="$token = 'wn'"><xsl:call-template name="week-number"><xsl:with-param name="date" select="substring($datetime,1,8)" /></xsl:call-template></xsl:when><xsl:when test="$token = 'hm'"><xsl:variable name="hm" select="number(substring($datetime,9,2))" /><xsl:choose><xsl:when test="$hm &gt; 12"><xsl:value-of select="$hm - 12" /></xsl:when><xsl:otherwise><xsl:value-of select="$hm" /></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$token = 'hh'"><xsl:value-of select="substring($datetime,9,2)" /></xsl:when><xsl:when test="$token = 'h'"><xsl:value-of select="number(substring($datetime,9,2))" /></xsl:when><xsl:when test="$token = 'nn'"><xsl:value-of select="substring($datetime,11,2)" /></xsl:when><xsl:when test="$token = 'n'"><xsl:value-of select="number(substring($datetime,11,2))" /></xsl:when><xsl:when test="$token = 'ss'"><xsl:value-of select="substring($datetime,13,2)" /></xsl:when><xsl:when test="$token = 's'"><xsl:value-of select="number(substring($datetime,13,2))" /></xsl:when><xsl:when test="$token = 'apm'"><xsl:variable name="apm" select="concat('[',number(substring($datetime,9,2)) mod 12,']')" /><xsl:value-of select="substring-before(substring($am-pm-names,string-length(substring-before($am-pm-names,$apm)) + 4),'[')" /></xsl:when><xsl:when test="string-length(translate(substring($token,1,1),$entity-apos,'')) = 0"><xsl:value-of select="substring($token,2,string-length($token) - 2)" /></xsl:when><xsl:when test="string-length(translate(substring($token,1,1),$entity-quot,'')) = 0"><xsl:value-of select="substring($token,2,string-length($token) - 2)" /></xsl:when><xsl:otherwise><xsl:value-of select="$token" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: local-to-UTC
 Description: Converts a local date/time (in the format yyyymmddThhmmssZ+-hhmm
              or yyyy-mm-ddThh:mm:ssZ+-hh:mm) to a UTC date/time.
 Parameters:-
   <datetime> the local date/time to be converted.
--><xsl:template name="local-to-UTC"><xsl:param name="datetime" /><!-- get the time zone offset part of the date/time --><xsl:variable name="local-offset"><xsl:choose><xsl:when test="contains($datetime,'Z')"><!-- get the local offset portion (and strip out '+' and ':' chars) --><xsl:variable name="offset-portion" select="translate(substring-after($datetime,'Z'),'+:','')" /><xsl:choose><xsl:when test="string-length($offset-portion) = 0">0</xsl:when><xsl:otherwise><!-- convert hours/mins to a numeric value --><xsl:variable name="offset-val"><xsl:call-template name="time-to-float"><xsl:with-param name="time" select="translate($offset-portion,'-','')" /></xsl:call-template></xsl:variable><!-- adjust value + or - --><xsl:choose><xsl:when test="substring($offset-portion,1,1) = '-'"><xsl:value-of select="$offset-val" /></xsl:when><xsl:otherwise><xsl:value-of select="0 - $offset-val" /></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable><xsl:choose><xsl:when test="$local-offset != 0"><xsl:variable name="dt2" select="translate(substring-before($datetime,'Z'),'-T:','')" /><xsl:variable name="date-value"><xsl:call-template name="date-time-to-float"><xsl:with-param name="datetime" select="$dt2" /></xsl:call-template></xsl:variable><xsl:variable name="output-datetime"><xsl:call-template name="float-to-date-time"><xsl:with-param name="value" select="$date-value + $local-offset" /><xsl:with-param name="round-seconds" select="true()" /></xsl:call-template></xsl:variable><!-- if seconds specified on the original time then add these back on --><xsl:choose><xsl:when test="string-length($dt2) &gt; 12"><xsl:value-of select="concat($output-datetime,':',substring($dt2,13,2))" /></xsl:when><xsl:otherwise><xsl:value-of select="$output-datetime" /></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="concat($datetime,'Z')" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: UTC-to-local
 Description: Converts a UTC date/time (in the format yyyymmddThhmmss
              or yyyy-mm-ddThh:mm:ss) to a local date/time.
 Parameters:-
   <datetime>     the UTC date/time to be converted.
   <local-offset> the local time offset (in the format +hh:mm or
                  -hh:mm)
--><xsl:template name="UTC-to-local"><xsl:param name="datetime" /><xsl:param name="local-offset" select="'0000'" /><xsl:variable name="raw-offset" select="concat(substring('0000',1,4 - string-length(translate($local-offset,'+-:',''))),translate($local-offset,'+-:',''))" /><!-- calc the offset as a value --><xsl:variable name="offset"><xsl:choose><xsl:when test="$raw-offset = '0000'">0</xsl:when><xsl:otherwise><!-- convert hours/mins to a numeric value --><xsl:variable name="offset-val"><xsl:call-template name="time-to-float"><xsl:with-param name="time" select="$raw-offset" /></xsl:call-template></xsl:variable><!-- adjust value + or - --><xsl:choose><xsl:when test="contains($local-offset,'-')"><xsl:value-of select="0 - $offset-val" /></xsl:when><xsl:otherwise><xsl:value-of select="$offset-val" /></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:variable><xsl:choose><xsl:when test="$offset != 0"><xsl:variable name="dt2" select="translate($datetime,'-T:','')" /><xsl:variable name="date-value"><xsl:call-template name="date-time-to-float"><xsl:with-param name="datetime" select="$dt2" /></xsl:call-template></xsl:variable><xsl:variable name="output-datetime"><xsl:call-template name="float-to-date-time"><xsl:with-param name="value" select="$date-value + $offset" /><xsl:with-param name="round-seconds" select="true()" /></xsl:call-template></xsl:variable><xsl:variable name="plusminus"><xsl:choose><xsl:when test="contains($local-offset,'-')">-</xsl:when><xsl:otherwise>+</xsl:otherwise></xsl:choose></xsl:variable><!-- if seconds specified on the original time then add these back on --><xsl:choose><xsl:when test="string-length($dt2) &gt; 12"><xsl:value-of select="concat($output-datetime,':',substring($dt2,13,2),'Z',$plusminus,substring($raw-offset,1,2),':',substring($raw-offset,3,2))" /></xsl:when><xsl:otherwise><xsl:value-of select="concat($output-datetime,'Z',$plusminus,substring($raw-offset,1,2),':',substring($raw-offset,3,2))" /></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="concat($datetime,'Z')" /></xsl:otherwise></xsl:choose></xsl:template><!--
==========================================================================
    Template: local-to-local
 Description: Converts one local date/time (in the format yyyymmddThhmmssZ+-hhmm
              or yyyy-mm-ddThh:mm:ssZ+-hh:mm) to another local date/time based
              upon a given new local time offset.
 Parameters:-
   <datetime>     the local date/time to be converted.
   <local-offset> the new local time offset (in the format +hh:mm or
                  -hh:mm)
--><xsl:template name="local-to-local"><xsl:param name="datetime" /><xsl:param name="local-offset" select="'0000'" /><!-- get the time zone offset part of the date/time --><xsl:variable name="offset"><xsl:choose><xsl:when test="contains($datetime,'Z')"><!-- get the local offset portion (and strip out '+' and ':' chars) --><xsl:variable name="offset-portion" select="translate(substring-after($datetime,'Z'),'+:','')" /><xsl:choose><xsl:when test="string-length($offset-portion) = 0">0</xsl:when><xsl:otherwise><!-- convert hours/mins to a numeric value --><xsl:variable name="offset-val"><xsl:call-template name="time-to-float"><xsl:with-param name="time" select="translate($offset-portion,'-','')" /></xsl:call-template></xsl:variable><!-- adjust value + or - --><xsl:choose><xsl:when test="substring($offset-portion,1,1) = '-'"><xsl:value-of select="0 - $offset-val" /></xsl:when><xsl:otherwise><xsl:value-of select="$offset-val" /></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable><!-- calc the new offset --><xsl:variable name="raw-offset" select="concat(substring('0000',1,4 - string-length(translate($local-offset,'+-:',''))),translate($local-offset,'+-:',''))" /><xsl:variable name="new-offset"><xsl:choose><xsl:when test="$raw-offset = '0000'">0</xsl:when><xsl:otherwise><!-- convert hours/mins to a numeric value --><xsl:variable name="offset-val"><xsl:call-template name="time-to-float"><xsl:with-param name="time" select="$raw-offset" /></xsl:call-template></xsl:variable><!-- adjust value + or - --><xsl:choose><xsl:when test="contains($local-offset,'-')"><xsl:value-of select="0 - $offset-val" /></xsl:when><xsl:otherwise><xsl:value-of select="$offset-val" /></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:variable><!-- perform the final time differential --><xsl:choose><xsl:when test="($offset != 0) and ($new-offset != 0)"><xsl:variable name="diff-offset" select="$new-offset - $offset" /><xsl:variable name="dt2" select="translate(substring-before($datetime,'Z'),'-T:','')" /><xsl:variable name="date-value"><xsl:call-template name="date-time-to-float"><xsl:with-param name="datetime" select="$dt2" /></xsl:call-template></xsl:variable><xsl:variable name="output-datetime"><xsl:call-template name="float-to-date-time"><xsl:with-param name="value" select="$date-value + $diff-offset" /><xsl:with-param name="round-seconds" select="true()" /></xsl:call-template></xsl:variable><xsl:variable name="plusminus"><xsl:choose><xsl:when test="contains($local-offset,'-')">-</xsl:when><xsl:otherwise>+</xsl:otherwise></xsl:choose></xsl:variable><!-- if seconds specified on the original time then add these back on --><xsl:choose><xsl:when test="string-length($dt2) &gt; 12"><xsl:value-of select="concat($output-datetime,':',substring($dt2,13,2),'Z',$plusminus,substring($raw-offset,1,2),':',substring($raw-offset,3,2))" /></xsl:when><xsl:otherwise><xsl:value-of select="concat($output-datetime,'Z',$plusminus,substring($raw-offset,1,2),':',substring($raw-offset,3,2))" /></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="concat($datetime,'Z')" /></xsl:otherwise></xsl:choose></xsl:template></xsl:stylesheet>