0% found this document useful (0 votes)
108 views8 pages

XSLT Template Handling Guide

The document contains definitions for multiple XSLT templates (templateA, templateB, etc.) that are used to format and concatenate parameters in different ways. The templates handle spacing, punctuation, and text formatting of the parameters based on conditions.

Uploaded by

RaviArryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views8 pages

XSLT Template Handling Guide

The document contains definitions for multiple XSLT templates (templateA, templateB, etc.) that are used to format and concatenate parameters in different ways. The templates handle spacing, punctuation, and text formatting of the parameters based on conditions.

Uploaded by

RaviArryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

</xsl:otherwise>

</xsl:choose>
</xsl:template>
<xsl:template name="templateA">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:param name="third"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempThird">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$third"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">
<xsl:call-template name="templ_prop_EnumSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
<xsl:if test="(string-length($tempFirst)>0 or string-len
gth($tempSecond)>0) and string-length($tempThird)>0">
<xsl:call-template name="templ_prop_ListSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempThird)>0">
<xsl:value-of select="$tempThird"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="templateANoDot">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:param name="third"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempThird">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$third"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-length($tem
pSecond)>0">
<xsl:call-template name="templ_prop_EnumSeparator"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
<xsl:if test="(string-length($tempFirst)>0 or string-length($tem
pSecond)>0) and string-length($tempThird)>0">
<xsl:call-template name="templ_prop_ListSeparator"/>
</xsl:if>
<xsl:if test="string-length($tempThird)>0">
<xsl:value-of select="$tempThird"/>
</xsl:if>
</xsl:template>
<xsl:template name="templateB">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>

</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">
<xsl:call-template name="templ_prop_EnumSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="templateSpaceAB">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">
<xsl:call-template name="templ_prop_Space"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>

</xsl:call-template>
</xsl:template>
<xsl:template name="templateC">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">
<xsl:call-template name="templ_prop_ListSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="templateD">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:param name="third"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>

<xsl:variable name="tempThird">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$third"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">
<xsl:call-template name="templ_prop_Space"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:call-template name="templ_prop_OpenBracket"
/>
<xsl:value-of select="$tempSecond"/>
<xsl:call-template name="templ_prop_CloseBracket
"/>
</xsl:if>
<xsl:if test="(string-length($tempFirst)>0 or string-len
gth($tempSecond)>0) and string-length($tempThird)>0">
<xsl:call-template name="templ_prop_EnumSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempThird)>0">
<xsl:value-of select="$tempThird"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="templateE">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:param name="third"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempThird">

<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$third"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">
<xsl:call-template name="templ_prop_ListSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
<xsl:if test="(string-length($tempFirst)>0 or string-len
gth($tempSecond)>0) and string-length($tempThird)>0">
<xsl:call-template name="templ_prop_EnumSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempThird)>0">
<xsl:value-of select="$tempThird"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="templateH">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:call-template name = "ApplyItalicTitleNS">
<xsl:with-param name = "data">
<xsl:value-of select="$tempFirst"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>

<xsl:if test="string-length($tempFirst)>0 and string-len


gth($tempSecond)>0">
<xsl:call-template name="templ_prop_ListSeparato
r"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($temp)" mode="output
Html"/>
<xsl:variable name="lastChar">
<xsl:value-of select="substring($temp, string-length($te
mp))"/>
</xsl:variable>
<xsl:variable name="prop_EndChars">
<xsl:call-template name="templ_prop_EndChars"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($temp) = 0">
</xsl:when>
<xsl:when test="contains($prop_EndChars, $lastChar)">
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="templ_prop_Dot"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="templateAsB">
<xsl:param name="first"/>
<xsl:param name="second"/>
<xsl:variable name="tempFirst">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$first"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="tempSecond">
<xsl:call-template name="handleSpaces">
<xsl:with-param name="field" select="$second"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="temp">
<xsl:if test="string-length($tempFirst)>0">
<xsl:value-of select="$tempFirst"/>
</xsl:if>
<xsl:if test="string-length($tempFirst)>0 and string-len
gth($tempSecond)>0">

<xsl:call-template name="templ_prop_Space"/>
</xsl:if>
<xsl:if test="string-length($tempSecond)>0">
<xsl:value-of select="$tempSecond"/>
</xsl:if>
</xsl:variable>
<xsl:call-template name="appendFieldNoHandleSpaces_Dot">
<xsl:with-param name="field" select="$temp"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="templateCityStateProvince">
<xsl:value-of select="b:City"/>
<xsl:if test="string-length(b:City)>0 and string-length(b:StateP
rovince)>0">
<xsl:call-template name="templ_prop_ListSeparator"/>
</xsl:if>
<xsl:value-of select="b:StateProvince"/>
</xsl:template>
<xsl:template name="templateCPY">
<xsl:call-template name="templateA">
<xsl:with-param name="first">
<xsl:call-template name="templateCityStateProvin
ce" />
</xsl:with-param>
<xsl:with-param name="second" select="b:Publisher"/>
<xsl:with-param name="third" select="b:Year"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="templateCPYNoDot">
<xsl:call-template name="templateANoDot">
<xsl:with-param name="first"

You might also like