Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 416c9a772e
Fetching contributors…

Cannot retrieve contributors at this time

6549 lines (6334 sloc) 296.331 kb
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xal="http://xml.apache.org/xalan"
xmlns:x="http://exslt.org/common" exclude-result-prefixes="x">
<xsl:output method="html"/>
<!-- These are the files required to put a Product Finder on an SYI page -->
<!-- DEBUG INFO: Start build include: -->
<!--******************************************************************************
DT: Do not Pretty Print this file or change the format in anyway.
I've removed the carraige returns for each row so the cells are in a line.
This will remove noticeable white space from PF.
***********************************************************************************-->
<!-- Usage documentation
<template match="Attribute">
The template is to generate HTML elements of the currently parsed attribute such as label and input field.
<param name="attrId">Attribute id</param>
<param name="widgetType">
Type of widget to be generated..
<enum>
<value>normal<note>represents a widget that can have label and input box</note></value>
<value>text_message<note>represents a simple text message that needs to be displayed</note></value>
<value>date<note>represents a date widget</note></value>
</enum>
</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
</template>
-->
<xsl:variable name="CatalogEnabled" select="(/ebay/Sale/Item/Attributes/AttributeSet/CatalogEnabled or /ebay/V2CatalogEnabled)"/>
<xsl:variable name="IsPassVehicles" select="boolean(/ebay/Sale/Item/Properties/IsAutosCar)"/>
<xsl:variable name="IsSiteAutos" select="boolean(/ebay/Environment/@siteId='100')"/>
<xsl:variable name="IsVehicles" select="boolean(/ebay/Sale/Item/Properties[IsAutosCar or IsAutosMotorcycle or IsAutosPowersports])"/>
<xsl:variable name="IsColPad">
<xsl:choose>
<xsl:when test="$IsVehicles">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="false()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ColSpan">
<xsl:choose>
<xsl:when test="$IsVehicles">
<xsl:value-of select="'1'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'2'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template match="Attribute">
<xsl:param name="attrId" select="@id"/>
<xsl:param name="widgetType"/>
<xsl:param name="attrMessagePFTop" select="../Message[@quadrant='top']"/>
<xsl:param name="attrMessagePFBottom" select="../Message[@quadrant='bottom' and .!='&amp;nbsp;']"/>
<xsl:param name="attrMessagePFLeft" select="../Message[@quadrant='left']"/>
<xsl:param name="attrMessagePFRight" select="../Message[@quadrant='right']"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:variable name="attrMessageTop" select="normalize-space($CurrentAttributeXPath[@id = $attrId]/MessageTop)"/>
<xsl:variable name="attrMessageBottom" select="normalize-space($CurrentAttributeXPath[@id = $attrId]/MessageBottom)"/>
<xsl:variable name="attrMessageLeft" select="normalize-space($CurrentAttributeXPath[@id = $attrId]/MessageLeft)"/>
<xsl:variable name="attrMessageRight" select="normalize-space($CurrentAttributeXPath[@id = $attrId]/MessageRight)"/>
<xsl:variable name="isLabelVisible" select="boolean($CurrentAttributeXPath[@id=$attrId and @labelVisible = 'true'])"/>
<xsl:variable name="VCSID" select="../../../../../@id"/>
<xsl:if test="$subPage = 'API' and $CurrentAttributeXPath/Dependency[@childAttrId=$attrId and @type='5'] ">
<input type="hidden" name="attr_required_{$VCSID}_{$attrId}" value="true"/>
</xsl:if>
<!-- BUGDB00146474 remove messages from API -->
<xsl:variable name="ShowMessage">
<xsl:choose>
<xsl:when test=" $SelectedAttributeXPath[@id=$attrId]/@removeMsg != '' and $SelectedAttributeXPath[@id=$attrId]/@removeMsg = 'true' ">
<xsl:value-of select="false()" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="true()" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<!-- Changed for SYI Motors conversion -->
<!-- Display a textbox for all/other models: -16 -->
<xsl:when test="$attrId=$Attr.Model and $IsPassVehicles and /ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$attrId]/Value/@id=-16">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- If RYI and item has a bid, or has less than 12 hours left, the model is displayed as non-editable
I need the model here because some files do not use SyiGlobal.xsl
-->
<xsl:choose>
<xsl:when test="/ebay/SellerOptions/HasBidsOrPurchases or /ebay/SellerOptions/IsLessThan12Hours">
<font face="Arial, Helvetica, sans-serif" size="2">
Model: <xsl:value-of select="/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$attrId]/Value/DisplayName"/>
<input type="hidden" name="{concat('attr_s',$VCSID, '_', $attrId)}" value="{/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$attrId]/Value/DisplayName}"/>
</font>
</xsl:when>
<xsl:otherwise>
<table border="0" cellpadding="0" cellspacing="0">
<xsl:call-template name="AttributeQuadrantTop">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
<!-- Add the error message for this text box -->
<xsl:if test="boolean(/ebay/Errors/Error[@id='SYI.BIZ.802'])">
<tr class="Error">
<td width="150"></td>
<td><font id="Error" face="Arial, Helvetica, sans-serif" size="2" color="#CC0000">
Please enter no more than 40 characters.</font></td>
</tr>
</xsl:if>
</table>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</table>
</td>
</tr>
</xsl:when>
<xsl:when test="$SelectedAttributeXPath[@id=$attrId and @noEdit='true'] and $CurrentAttributeXPath[@id=$attrId and (EditType = 1 or EditType = 2)]">
<xsl:choose>
<!-- Changed for SYI Motors conversion -->
<!-- Manufacturer and model are to be passed only as hidden, the hardcoding is required becuase the PI does not support the dynamic change -->
<xsl:when test="not($attrId = $Attr.Manufacturer or $attrId = $Attr.Model) ">
<tr>
<td nowrap="nowrap" width="80" valign="top">
<xsl:if test="$thisPage='SYI' and ($SelectedAttributeXPath[@id=$attrId]/Value[@id > 0] or $SelectedAttributeXPath[@id=$attrId]/Value[@id = -6 or @id = -3])">
<input type="hidden" name="{concat('attr_h',$VCSID, '_', $attrId)}">
<xsl:attribute name="value"><xsl:for-each select="$SelectedAttributeXPath[@id=$attrId]/Value"><xsl:value-of select="@id"/><xsl:if test="position() != last()">,</xsl:if></xsl:for-each></xsl:attribute>
</input>
</xsl:if>
<xsl:choose>
<xsl:when test="$isLabelVisible">
<xsl:apply-templates select="Label" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>&#160;</xsl:otherwise>
</xsl:choose>
</td>
<td width="10">&#160;&#160;</td>
<td valign="top">
<xsl:apply-templates select="Input" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<!-- Changed for SYI motors conversion -->
<!-- Display Year Make: Model -->
<xsl:if test="$attrId=$Attr.Manufacturer and $CatalogEnabled">
<tr>
<td>
<b>
<xsl:value-of select="/ebay/SYI.Data/ProductAttributes/Attribute[@id=$Attr.Year]/ValueList/Value/Name"/>&#160;<xsl:value-of select="/ebay/SYI.Data/ProductAttributes/Attribute[@id=$Attr.Manufacturer]/ValueList/Value/Name"/>
<xsl:if test="boolean(/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$Attr.Model])">
&#160;:&#160;<xsl:value-of select="/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$Attr.Model]/Value/Name"/>
</xsl:if>
</b>
</td>
</tr>
</xsl:if>
<!-- Changed for SYI motors conversion -->
<!-- Send a hidden variable for all attributes which are hidden -->
<input type="hidden" name="{concat('attr_h',$VCSID,'_',$attrId)}" value="{/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$attrId]/Value/@id}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$SelectedAttributeXPath[@id=$attrId and @noEdit='true'] and not($IsSiteAutos)">
<xsl:if test="Label[.!='&#160;' or .!='spacer'] or $isLabelVisible">
<tr>
<td nowrap="nowrap" valign="top">
<xsl:apply-templates select="Label" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</tr>
</xsl:if>
<tr>
<td valign="top">
<xsl:if test="$thisPage='SYI' and ($SelectedAttributeXPath[@id=$attrId]/Value[@id > 0] or $SelectedAttributeXPath[@id=$attrId]/Value[@id = -6 or @id = -3])">
<input type="hidden" name="{concat('attr_h',$VCSID, '_', $attrId)}">
<xsl:attribute name="value"><xsl:for-each select="$SelectedAttributeXPath[@id=$attrId]/Value"><xsl:value-of select="@id"/><xsl:if test="position() != last()">,</xsl:if></xsl:for-each></xsl:attribute>
</input>
</xsl:if>
<xsl:apply-templates select="Input" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</tr>
</xsl:when>
<xsl:when test="$SelectedAttributeXPath[@id=$attrId and @noEdit='true'] and $IsSiteAutos">
<tr>
<xsl:choose>
<xsl:when test="$attrId=$Attr.StandardEqp or $attrId=$Attr.OptionalEqp or $attrId=$Attr.Options or $attrId=$Attr.SafetyFeatures or $attrId=$Attr.PowerOptions and (/ebay/SellerOptions/HasBidsOrPurchases or /ebay/SellerOptions/IsLessThan12Hours)">
<xsl:if test="Label[.!='&#160;' or .!='spacer'] or $isLabelVisible">
<td nowrap="nowrap" valign="top" width="160">
<xsl:apply-templates select="Label" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</xsl:if>
<td>
<xsl:if test="$thisPage='SYI' and ($SelectedAttributeXPath[@id=$attrId]/Value[@id > 0] or $SelectedAttributeXPath[@id=$attrId]/Value[@id = -6 or @id = -3])">
<input type="hidden" name="{concat('attr_h',$VCSID, '_', $attrId)}">
<xsl:attribute name="value"><xsl:for-each select="$SelectedAttributeXPath[@id=$attrId]/Value"><xsl:value-of select="@id"/><xsl:if test="position() != last()">,</xsl:if></xsl:for-each></xsl:attribute>
</input>
</xsl:if>
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</xsl:when>
<xsl:otherwise>
<xsl:if test="Label[.!='&#160;' or .!='spacer'] or $isLabelVisible">
<td nowrap="nowrap" valign="top" width="160">
<xsl:apply-templates select="Label" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</xsl:if>
<td>
<xsl:if test="$thisPage='SYI' and ($SelectedAttributeXPath[@id=$attrId]/Value[@id > 0] or $SelectedAttributeXPath[@id=$attrId]/Value[@id = -6 or @id = -3])">
<input type="hidden" name="{concat('attr_h',$VCSID, '_', $attrId)}">
<xsl:attribute name="value"><xsl:for-each select="$SelectedAttributeXPath[@id=$attrId]/Value"><xsl:value-of select="@id"/><xsl:if test="position() != last()">,</xsl:if></xsl:for-each></xsl:attribute>
</input>
</xsl:if>
<xsl:apply-templates select="Input" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:when>
<xsl:when test="$widgetType='normal'">
<xsl:if test="($attrMessageTop != '' and $ShowMessage = 'true' ) or $attrMessagePFTop">
<tr>
<td>
<xsl:attribute name="colspan"><xsl:if test="$attrMessagePFTop and $thisPage='PF'">3</xsl:if></xsl:attribute>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageTop"/>
<xsl:with-param name="messageStyle" select="../MessageTop"/>
<xsl:with-param name="attrMessagePF" select="$attrMessagePFTop"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
<!-- changed for SYI Motors -->
<xsl:choose>
<xsl:when test="$IsSiteAutos">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<xsl:if test="($attrMessageLeft!= '' and $ShowMessage = 'true' ) or $attrMessagePFLeft">
<td>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageLeft"/>
<xsl:with-param name="messageStyle" select="../MessageLeft"/>
<xsl:with-param name="attrMessagePF" select="$attrMessagePFLeft"/>
</xsl:call-template>
</td>
</xsl:if>
<td>
<!-- output input and label -->
<table border="0" cellpadding="0" cellspacing="0">
<xsl:choose>
<xsl:when test="@quadrant = 'bottom'">
<xsl:call-template name="AttributeQuadrantBottom">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'top'">
<xsl:call-template name="AttributeQuadrantTop">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="MessageRight" select="../MessageRight"/>
</xsl:call-template>
<xsl:if test="$thisPage='SYI' and NoJS">
<noscript>
<tr>
<td>
<xsl:copy-of select="$Image.ArrowMaroon"/>
<font size="2" face="Arial, Helvetica, sans-serif">Click Update below to see relevant choices</font>
</td>
</tr>
</noscript>
</xsl:if>
</xsl:when>
<xsl:when test="@quadrant = 'left'">
<xsl:call-template name="AttributeQuadrantLeft">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'right'">
<xsl:call-template name="AttributeQuadrantRight">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<tr>
<td>
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</table>
<!-- end input and label -->
</td>
</tr>
</table>
</td>
</tr>
</xsl:when>
<!-- changed so that SYI Motors cases don;t affect the other sites -->
<xsl:otherwise>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<xsl:if test="($attrMessageLeft!= '' and $ShowMessage = 'true' ) or $attrMessagePFLeft">
<td>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageLeft"/>
<xsl:with-param name="messageStyle" select="../MessageLeft"/>
<xsl:with-param name="attrMessagePF" select="$attrMessagePFLeft"/>
</xsl:call-template>
</td>
</xsl:if>
<td>
<!-- output input and label -->
<table border="0" cellpadding="0" cellspacing="0">
<xsl:choose>
<xsl:when test="@quadrant = 'bottom'">
<xsl:call-template name="AttributeQuadrantBottom">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'top'">
<xsl:call-template name="AttributeQuadrantTop">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
<xsl:if test="$thisPage='SYI' and NoJS">
<noscript>
<tr>
<td>
<xsl:copy-of select="$Image.ArrowMaroon"/>
<font size="2" face="Arial, Helvetica, sans-serif">Click Update below to see relevant choices</font>
</td>
</tr>
</noscript>
</xsl:if>
</xsl:when>
<xsl:when test="@quadrant = 'left'">
<xsl:call-template name="AttributeQuadrantLeft">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'right'">
<xsl:call-template name="AttributeQuadrantRight">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<tr>
<td>
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</table>
<!-- end input and label -->
</td>
<xsl:if test="($attrMessageRight!= '' and $ShowMessage = 'true' ) or $attrMessagePFRight">
<td valign="top">
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageRight"/>
<xsl:with-param name="messageStyle" select="../MessageRight"/>
<xsl:with-param name="attrMessagePF" select="$attrMessagePFRight"/>
</xsl:call-template>
</td>
</xsl:if>
</tr>
</table>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
<!-- changed for SYI Motors as message at bottom is shown differently -->
<xsl:if test="($attrMessageBottom != '' and $ShowMessage = 'true' ) or $attrMessagePFBottom">
<xsl:choose>
<!-- Suppress the VIN message for Motors flow. BUGDB00170660 -->
<xsl:when test="$IsSiteAutos and $attrId = $Attr.VIN">
</xsl:when>
<xsl:when test="$IsSiteAutos and not($attrId = $Attr.VIN and $CatalogEnabled)">
<tr valign="top">
<td valign="top">
<xsl:attribute name="colspan"><xsl:if test="$attrMessagePFBottom and $thisPage='PF'">3</xsl:if></xsl:attribute>
<table width="100%">
<tr valign="top">
<xsl:if test="$IsColPad">
<td width="150" valign="top">&#160;</td>
</xsl:if>
<td valign="top">
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageBottom"/>
<xsl:with-param name="messageStyle" select="../MessageBottom"/>
<xsl:with-param name="attrMessagePF" select="$attrMessagePFBottom"/>
</xsl:call-template>
</td>
</tr>
</table>
</td>
</tr>
</xsl:when>
<xsl:when test="not($IsSiteAutos)">
<tr>
<td>
<xsl:attribute name="colspan"><xsl:if test="$attrMessagePFBottom and $thisPage='PF'">3</xsl:if></xsl:attribute>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageBottom"/>
<xsl:with-param name="messageStyle" select="../MessageBottom"/>
<xsl:with-param name="attrMessagePF" select="$attrMessagePFBottom"/>
</xsl:call-template>
</td>
</tr>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:when>
<!-- end widget type = "normal" -->
<xsl:otherwise>
<td>
<!-- valign="top" -->
<table border="0" cellpadding="0" cellspacing="0">
<!-- BUGDB00146474 remove messages from API -->
<xsl:if test="$attrMessageTop != '' and $ShowMessage = 'true' ">
<tr>
<td>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageTop"/>
<xsl:with-param name="messageStyle" select="../MessageTop"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
<tr>
<!--
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
-->
<!-- BUGDB00146474 remove messages from API -->
<xsl:if test="$attrMessageLeft!= '' and $ShowMessage = 'true' ">
<td>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageLeft"/>
<xsl:with-param name="messageStyle" select="../MessageLeft"/>
</xsl:call-template>
</td>
</xsl:if>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<!-- display label and input -->
<xsl:choose>
<xsl:when test="@quadrant = 'bottom'">
<xsl:call-template name="AttributeQuadrantBottom">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'top'">
<xsl:call-template name="AttributeQuadrantTop">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'left'">
<xsl:call-template name="AttributeQuadrantLeft">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@quadrant = 'right'">
<xsl:call-template name="AttributeQuadrantRight">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<tr>
<td>
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>&#160;
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
<!-- end display label and input -->
</table>
</td>
<xsl:if test="$attrMessageRight!= '' and $ShowMessage = 'true'">
<td>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageRight"/>
<xsl:with-param name="messageStyle" select="../MessageRight"/>
</xsl:call-template>
</td>
</xsl:if>
<!--
</tr>
</table>
</td>
-->
</tr>
<!-- BUGDB00146474 remove messages from API -->
<xsl:if test="$attrMessageBottom != '' and $ShowMessage = 'true' ">
<tr>
<td>
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMessageBottom"/>
<xsl:with-param name="messageStyle" select="../MessageBottom"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
</table>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- =================================================================
Attribute Quadrant Bottom
================================================================== -->
<!--
<template name="AttributeQuadrantBottom">
The template is used to generate attribute with label arranged below the input box.
<param name="attrId">Attribute id</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
</template>
-->
<xsl:template name="AttributeQuadrantBottom">
<xsl:param name="attrId"/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:variable name="isLabelVisible">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:value-of select="$CurrentAttributeXPath[@id=$attrId]/@labelVisible"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'true'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="IsOtherSelected">
<xsl:if test="$subPage='API' ">
<xsl:apply-templates mode="IsOtherSelected" select="Input">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</xsl:variable>
<tr>
<td>
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
<xsl:if test="$IsOtherSelected = 'selected' ">
<xsl:apply-templates mode="API.Other" select="$CurrentAttributeXPath/../../Other/Attribute[@id = $attrId]">
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</td>
</tr>
<tr>
<td>
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]">
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="Label">&#160;</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</td>
</tr>
<xsl:call-template name="AttributeError">
<xsl:with-param name="InputId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
</xsl:call-template>
</xsl:template>
<!-- =================================================================
Attribute Quadrant Top
================================================================== -->
<!--
<template name="AttributeQuadrantTop">
The template is used to generate attribute with label arranged above the input box.
<param name="attrId">Attribute id</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
</template>
-->
<xsl:template name="AttributeQuadrantTop">
<xsl:param name="attrId"/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:param name="MessageRight"/>
<xsl:variable name="isLabelVisible">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:value-of select="$CurrentAttributeXPath[@id=$attrId]/@labelVisible"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'true'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="IsOtherSelected">
<xsl:if test="$subPage='API' ">
<xsl:apply-templates mode="IsOtherSelected" select="Input">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</xsl:variable>
<!-- Changed for SYI motors conversion
Motors Item specific display needs to be in the V2 format
Hence a special check is required
-->
<xsl:if test="not($IsSiteAutos)">
<tr align="{@align}">
<td valign="top">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]">
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="Label">&#160;</xsl:when>
<xsl:otherwise/>
</xsl:choose><img height="2" src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="5"/>
</td>
</tr>
<tr align="{@align}">
<td>
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
<xsl:if test="$IsOtherSelected = 'selected'">
<xsl:apply-templates mode="API.Other" select="$CurrentAttributeXPath/../../Other/Attribute[@id = $attrId]">
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:apply-templates>
</xsl:if><img height="2" src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="5"/>
</td>
</tr>
</xsl:if>
<!--
Changed for SYI Motors conversion.
Some attributes need the current form generator fields.
They are hardcoded. Some don't! -->
<xsl:if test="$IsSiteAutos">
<xsl:choose>
<xsl:when test="$attrId=$Attr.StandardEqp or $attrId=$Attr.OptionalEqp">
<tr align="{@align}">
<td valign="top">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]">
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="Label">&#160;</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</td><img height="2" src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="5"/>
</tr>
<tr align="{@align}">
<td>
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
<xsl:if test="$IsOtherSelected = 'selected'">
<xsl:apply-templates mode="API.Other" select="$CurrentAttributeXPath/../../Other/Attribute[@id = $attrId]">
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:apply-templates>
</xsl:if><img height="2" src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="5"/>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<tr align="{@align}">
<!-- Dirty motors code to show the attributes in v2 format -->
<td valign="top" width="160">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]">
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="Label">&#160;</xsl:when>
<xsl:otherwise/>
</xsl:choose><img height="2" src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="5"/>
</td>
<xsl:variable name="attrMsgRight" select="normalize-space($CurrentAttributeXPath[@id = $attrId]/MessageRight)"/>
<td>
<!-- <xsl:choose>
<xsl:when test="(/ebay/SellerOptions/HasBidsOrPurchases or /ebay/SellerOptions/IsLessThan12Hours) and $SelectedAttributeXPath[@id=$attrId]/Value/@id != -10">
<xsl:apply-templates select="Input" mode="ryi">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise> -->
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
<!-- </xsl:otherwise>
</xsl:choose> -->
<xsl:if test="$IsOtherSelected = 'selected'">
<xsl:apply-templates mode="API.Other" select="$CurrentAttributeXPath/../../Other/Attribute[@id = $attrId]">
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
<xsl:if test="$attrMsgRight != ''">
<xsl:call-template name="DisplayMessage">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="attrMessage" select="$attrMsgRight"/>
<xsl:with-param name="messageStyle" select="$MessageRight"/>
<xsl:with-param name="attrMessagePF" select="true()"/>
</xsl:call-template>
</xsl:if><img height="2" src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="5"/>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:call-template name="AttributeError">
<xsl:with-param name="InputId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="Col" select="$ColSpan"/>
<xsl:with-param name="ColPad" select="$IsColPad"/>
</xsl:call-template>
</xsl:template>
<!-- =================================================================
Attribute Quadrant Left
================================================================== -->
<!--
<template name="AttributeQuadrantLeft">
The template is used to generate attribute with label arranged on the left of the input box.
<param name="attrId">Attribute id</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
</template>
-->
<xsl:template name="AttributeQuadrantLeft">
<xsl:param name="attrId"/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:variable name="isLabelVisible">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:value-of select="$CurrentAttributeXPath[@id=$attrId]/@labelVisible"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'true'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="IsOtherSelected">
<xsl:if test="$subPage='API' ">
<xsl:apply-templates mode="IsOtherSelected" select="Input">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</xsl:variable>
<tr align="{@align}">
<td valign="middle">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]">
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>&#160;</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
<xsl:if test="$IsOtherSelected = 'selected'">
<xsl:apply-templates mode="API.Other" select="$CurrentAttributeXPath/../../Other/Attribute[@id = $attrId]">
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</td>
</tr>
<xsl:call-template name="AttributeError">
<xsl:with-param name="InputId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="Col" select="'2'"/>
</xsl:call-template>
</xsl:template>
<!-- =================================================================
Attribute Quadrant Right
================================================================== -->
<!--
<template name="AttributeQuadrantRight">
The template is used to generate attribute with label arranged on the right of the input box.
<param name="attrId">Attribute id</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
</template>
-->
<xsl:template name="AttributeQuadrantRight">
<xsl:param name="attrId"/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:variable name="isLabelVisible">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:value-of select="$CurrentAttributeXPath[@id=$attrId]/@labelVisible"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'true'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="IsOtherSelected">
<xsl:if test="$subPage='API' ">
<xsl:apply-templates mode="IsOtherSelected" select="Input">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</xsl:variable>
<tr>
<td align="{@align}">
<xsl:apply-templates select="Input" mode="attributes">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
<xsl:if test="$IsOtherSelected = 'selected'">
<xsl:apply-templates mode="API.Other" select="$CurrentAttributeXPath/../../Other/Attribute[@id = $attrId]">
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:apply-templates>
</xsl:if>
</td>
<td valign="middle">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:attribute name="nowrap"><xsl:value-of select="'nowrap'"/></xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]">
<xsl:apply-templates select="Label">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>&#160;</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<xsl:call-template name="AttributeError">
<xsl:with-param name="InputId" select="$attrId"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="Col" select="'2'"/>
</xsl:call-template>
</xsl:template>
<!-- DEBUG INFO: End build include: ..\XSL\en-US\Global\shared/attr_attribute.xsl -->
<!-- DEBUG INFO: Start build include: -->
<!--
<template name="CheckboxRadio">
The template is to generate attribute as a set of checboxes or radioboxes, based on the parameter type passed..
<param name="attrId">Attribute id</param>
<param name="columns">Number of columns per row to be used to arrange input boxes.</param>
<param name="type">
Type of the input box.
<enum>
<value>checkbox<note>to generate checkbox element</note></value>
<value>radio<note>to generate radiobox element</note></value>
</enum>
</param>
<param name="inputName">Name of the input box that.</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
</template>
-->
<xsl:template name="CheckboxRadio">
<xsl:param name="attrId"/>
<xsl:param name="columns"/>
<xsl:param name="type"/>
<xsl:param name="inputName"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:param name="VCSID"/>
<xsl:variable name="IsSiteAutos" select="boolean(/ebay/Environment/@siteId='100')"/>
<table cellpadding="0" cellspacing="0" border="0">
<xsl:variable name="syiParentAttrId" select="$CurrentAttributeXPath[Dependency/@childAttrId=$attrId]/@id"/>
<xsl:variable name="syiParentValueId" select="$SelectedAttributeXPath[@id=$syiParentAttrId]/Value/@id[. = $CurrentAttributeXPath/Dependency[@childAttrId=$attrId]/@parentValueId]"/>
<xsl:variable name="dependentAttrValues" select="$CurrentAttributeXPath[@id=$syiParentAttrId]/Dependency[@parentValueId=$syiParentValueId and @childAttrId=$attrId]/Value[count(. | key('attrByIDs', concat($VCSID, '_', key('selectedAttrByIDs', concat($VCSID, '_', ../../../@id, '_', ../@parentValueId))/@id, '_', @id))[1])=1]"/>
<xsl:variable name="attrValues" select="$CurrentAttributeXPath[@id=$attrId]/ValueList/Value"/>
<xsl:variable name="attrs" select="$attrValues | $dependentAttrValues[@id != 0] | $CurrentAttributeXPath[@id=$syiParentAttrId and $subPage != 'API']/Dependency[@childAttrId=$attrId]/Value"/>
<xsl:for-each select="$attrs">
<xsl:variable name="position" select="position()"/>
<xsl:variable name="last" select="last()"/>
<xsl:if test="(($position mod $columns) = 1) or $columns=1">
<xsl:variable name="cols">
<xsl:choose>
<xsl:when test="$position + $columns &gt; $last">
<xsl:value-of select="$last - $position + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$columns"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr>
<xsl:call-template name="WidgetGroupTableCell">
<xsl:with-param name="attrs" select="$attrs[position() &gt;= $position]"/>
<xsl:with-param name="cols" select="$cols"/>
<xsl:with-param name="max" select="$cols"/>
<xsl:with-param name="inputName" select="$inputName"/>
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="WidgetType" select="$type"/>
<xsl:with-param name="IsEmpty" select="not($SelectedAttributeXPath[@id=$attrId]/Value)"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="isDefault" select="@isDefault"/>
</xsl:call-template>
<!-- IF LAST ROW IS INCOMPLETE, FINISH IT -->
<xsl:if test="((last()-position()) &lt; $columns) and ((last() mod $columns) != 0)">
<td>
<xsl:attribute name="colspan"><xsl:value-of select="$columns - (last() mod $columns)"/></xsl:attribute>
</td>
</xsl:if>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</xsl:template>
<!--
<template name="WidgetGroupTableCell">
The template is to generate a row of check/radiobox elements for the attribute. It's used by the template with the name="CheckboxRadio".
<param name="attrs">A subset of attribute values that follow the value already parsed or the full set if it's a starting point</param>
<param name="cols">Number of columns left to generate in the row. Used in decremental order. The template is recursively called until cols is 0</param>
<param name="max">Number of columns to generate, used to keep track of how many needs to be generated during recursive calls</param>
<param name="inputName">Name of the input box that.</param>
<param name="attrId">Attribute id</param>
<param name="WidgetType">
Type of the input box.
<enum>
<value>checkbox<note>to generate checkbox element</note></value>
<value>radio<note>to generate radiobox element</note></value>
</enum>
</param>
<param name="IsEmpty">Says if the attribute has no values currently selected</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
</template>
-->
<xsl:template name="WidgetGroupTableCell">
<xsl:param name="attrs"/>
<xsl:param name="cols"/>
<xsl:param name="max"/>
<!-- This template is used by radio buttons and check boxes. -->
<xsl:param name="inputName"/>
<xsl:param name="attrId"/>
<xsl:param name="WidgetType"/>
<xsl:param name="IsEmpty"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:param name="VCSID"/>
<xsl:param name="isDefault"/>
<xsl:variable name="getattrId" select="$attrs[$max - $cols + 1]/../../@id"/>
<xsl:variable name="getValueId" select="$attrs[$max - $cols + 1]/@id"/>
<xsl:variable name="hasDisplayName" select="boolean($attrs[$max - $cols + 1]/DisplayName!='')"/>
<!-- for multi-units: show 'DisplayName' is available, otherwise show 'Name'-->
<xsl:variable name="WidgetName" select="$attrs[$max - $cols + 1]/DisplayName[$hasDisplayName] | $attrs[$max - $cols + 1]/Name[not($hasDisplayName)]"/>
<xsl:variable name="IsDefault" select="$attrs[$max - $cols + 1]/IsDefault"/>
<!-- DT...Need further refactoring once Dependencies are consistent -->
<xsl:if test="$cols &gt; 0">
<td valign="top">
<xsl:choose>
<xsl:when test="$thisPage='SYI'">
<xsl:variable name="CBValue">
<!-- This is the check to show the Option String instead of attribute value, when the attribute value = -3 -->
<xsl:choose>
<xsl:when test="$getValueId = -3">
<xsl:value-of select="$WidgetName"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$getValueId"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="FieldName" select="concat('attr',$VCSID,'_',$attrId)"/>
<xsl:choose>
<xsl:when test="$SelectedAttributeXPath[@id=$attrId and @noEdit='true'] and $IsSiteAutos and ($attrId=$Attr.Options or $attrId=$Attr.SafetyFeatures or $attrId=$Attr.PowerOptions and (/ebay/SellerOptions/HasBidsOrPurchases or /ebay/SellerOptions/IsLessThan12Hours)) and (($UsePostedFormFields and $getValueId = $FormFields/FormField[@name = $FieldName]/Value) or $SelectedAttributeXPath[@id=$getattrId]/Value[@id=$getValueId] or ($IsEmpty and $IsDefault) or $subPage='API' and $SelectedAttributeXPath[@id=$attrId]/Value[@id=$getValueId])">
<img src="http://pics.ebaystatic.com/aw/pics/check_14x16.gif" width="14" height="16"/>
<img src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="6" height="1"/>
<!-- <input type="hidden" name="{$FieldName}" value="{$CBValue}"/> -->
</xsl:when>
<xsl:when test="$SelectedAttributeXPath[@id=$attrId and @noEdit='true'] and $IsSiteAutos and ($attrId=$Attr.StandardEqp or $attrId=$Attr.OptionalEqp) and (/ebay/SellerOptions/HasBidsOrPurchases or /ebay/SellerOptions/IsLessThan12Hours) and /ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$attrId]//Name=$WidgetName">
<img src="http://pics.ebaystatic.com/aw/pics/check_14x16.gif" width="14" height="16"/>
<img src="http://pics.ebaystatic.com/aw/pics/spacer.gif" width="6" height="1"/>
</xsl:when>
<xsl:otherwise>
<input type="{$WidgetType}" value="{$CBValue}">
<xsl:choose>
<xsl:when test="$subPage = 'API' and $CurrentAttributeXPath[@id=$attrId]/Dependency[@type='4' or @type='3' or type='5']">
<xsl:attribute name="onClick">vvc_anyParent('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>','attr<xsl:value-of select="$getValueId"/>'); vvsp_check('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>', this.value);</xsl:attribute>
<!-- JO: commented out Post for type 4 because conditionally visible attributes are moved over to next page (multi-page flow), SYI only. -->
<!-- VVSP / Conditional Attribute (VA) -->
</xsl:when>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='1' or @type='2']">
<xsl:attribute name="onClick">vvc_anyParent('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>','attr<xsl:value-of select="$getValueId"/>');</xsl:attribute>
<!-- VVC or VVP -->
</xsl:when>
<xsl:when test="$subPage = 'API' and $getValueId ='-6' ">
<xsl:attribute name="onClick">api_check_on_other('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>',-6);</xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:attribute name="name"><xsl:value-of select="$FieldName"/></xsl:attribute>
<xsl:if test="($UsePostedFormFields and $getValueId = $FormFields/FormField[@name = $FieldName]/Value) or $SelectedAttributeXPath[@id=$getattrId]/Value[@id=$getValueId] or ($IsEmpty and $IsDefault) or $subPage='API' and $SelectedAttributeXPath[@id=$attrId]/Value[@id=$getValueId]">
<!-- Added for motors VIN flow. If an attribute is present in the characteristic set but not present in Item Attributes
display that attribute, but do not show it selected. -->
<xsl:choose>
<xsl:when test="$IsSiteAutos">
<xsl:choose>
<!-- Added for VIN - Optional Equipment-->
<xsl:when test="$attrId=$Attr.OptionalEqp or $attrId=$Attr.StandardEqp">
<!-- Second time -->
<xsl:if test="/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id='10236']">
<xsl:if test="/ebay/Sale/Item/Attributes/AttributeSet/Attribute[@id=$attrId]//Name=$WidgetName">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</xsl:if>
<!-- Otherwise first time, do not show as prepopulated-->
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</input>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:variable name="ValueLabelStyle" select="$CurrentAttributeXPath/../../../PresentationInstruction/*/Row/Widget/Attribute[@id = $attrId]/Label"/>
<font size="2" face="Verdana,Geneva,Arial,Helvetica">
<xsl:copy-of select="$ValueLabelStyle/@*"/>
<xsl:choose>
<xsl:when test="$ValueLabelStyle/@bold='true' and @italic='true'">
<b>
<i>
<xsl:value-of select="$WidgetName"/>
</i>
</b>
</xsl:when>
<xsl:when test="$ValueLabelStyle/@bold='true'">
<b>
<xsl:value-of select="$WidgetName"/>
</b>
</xsl:when>
<xsl:when test="$ValueLabelStyle/@italic='true'">
<i>
<xsl:value-of select="$WidgetName"/>
</i>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$WidgetName"/>
</xsl:otherwise>
</xsl:choose>
</font>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pfId" select="$CurrentAttributeXPath[@id=$attrId]/InputFields/Input/Value/@pfId"/>
<xsl:variable name="pfPageType" select="$CurrentAttributeXPath[@id=$attrId]/InputFields/Input/Value/@pfPageType"/>
<input type="{$WidgetType}" value="{$getValueId}">
<!-- VVC or VVP -->
<xsl:if test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='1' or @type='2']">
<xsl:attribute name="onClick">vvc_anyParent('a<xsl:value-of select="$attrId"/>','a<xsl:value-of select="$getValueId"/>');</xsl:attribute>
</xsl:if>
<!-- Default values for PF are contained inside InputFields element. There's no IsDefault element for PF....there is now for 1.5 -->
<xsl:choose>
<xsl:when test="$pfId and $pfPageType and $isDefault='true'">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$SelectedAttributeXPath[@id=$attrId]/InputFields/Input/Value[@id=$getValueId]">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="name"><xsl:value-of select="$inputName"/></xsl:attribute>
</input>
</xsl:otherwise>
</xsl:choose>
</td>
<xsl:if test="$thisPage='SYI'">
<td width="10">&#160;</td>
</xsl:if>
<xsl:if test="$thisPage='PF'">
<td valign="top">
<img src="http://pics.ebaystatic.com/aw/pics/spacer.gif" height="3" width="1" alt=""/>
<br/>
<font face="{$thisPI[@id=$attrId]/Input/@face}" size="{$thisPI[@id=$attrId]/Input/@size}" color="{$thisPI[@id=$attrId]/Input/@color}">
<xsl:value-of select="$WidgetName"/>
</font>
</td>
</xsl:if>
<xsl:call-template name="WidgetGroupTableCell">
<xsl:with-param name="attrs" select="$attrs"/>
<xsl:with-param name="cols" select="$cols - 1"/>
<xsl:with-param name="max" select="$max"/>
<xsl:with-param name="inputName" select="$inputName"/>
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="WidgetType" select="$WidgetType"/>
<xsl:with-param name="IsEmpty" select="$IsEmpty"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="isDefault" select="following-sibling::Value/@isDefault"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- DEBUG INFO: End build include: ..\XSL\en-US\Global\shared/attr_checkbox_radio.xsl -->
<!-- DEBUG INFO: Start build include: -->
<!--
<template name="date_options">
The template is to generate a HTML option elements for the specified part of the date.
<param name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="attr_id">Attribute id</param>
<param name="date_sort">
Specifies the sorting order and the format of the date part
<enum>
<value>ascending<note>descending order</note></value>
<value>descending<note>ascending order</note></value>
</enum>
</param>
<param name="pi_node_set">Options definded in the Presentation Instructions</param>
<param optional="true" name="range_type">Only needed for PF date ranges</param>
<param optional="true" name="FieldName">Field name only needed for SYI (to pull data from PostedFormFields section</param>
</template>
-->
<xsl:template name="date_options">
<xsl:param name="format"/>
<xsl:param name="date_part"/>
<!-- REQUIRED: 'Day' | 'Month' | 'Year' -->
<xsl:param name="attr_id"/>
<!-- REQUIRED -->
<xsl:param name="date_sort"/>
<!-- REQUIRED FOR DAYS AND MONTHS: 'DayAscending' | 'DayDescending' | ... etc ... -->
<xsl:param name="pi_node_set"/>
<!-- REQUIRED FOR YEARS: options definded in the PI -->
<xsl:param name="range_type"/>
<!-- OPTIONAL: only needed for PF date ranges -->
<xsl:param name="FieldName"/>
<!-- OPTIONAL: only needed for SYI (to pull data from PostedFormFields section -->
<xsl:param name="SelectedAttributeXPath"/>
<!-- OPTIONAL: Needed for SYI when Listing in 2 categories -->
<xsl:param name="VCSID"/>
<!-- GET THE DEFAULT DATE -->
<xsl:variable name="default_val">
<xsl:call-template name="get_default_val">
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="attr_id" select="$attr_id"/>
<xsl:with-param name="range_type" select="$range_type"/>
<xsl:with-param name="FieldName" select="$FieldName"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
</xsl:call-template>
</xsl:variable>
<!-- GET SPECIFIC DATE STRINGS -->
<xsl:variable name="primary_match">
<xsl:choose>
<xsl:when test="$pi_node_set"><xsl:value-of select="$pi_node_set"/></xsl:when>
<xsl:otherwise>
<xsl:call-template name="get_date_strings">
<xsl:with-param name="date_sort" select="$date_sort"/>
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="match" select=" 'primary' "/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="date_text">
<xsl:choose>
<xsl:when test="$pi_node_set"><xsl:value-of select="$pi_node_set"/></xsl:when>
<xsl:otherwise>
<xsl:call-template name="get_date_strings">
<xsl:with-param name="date_sort" select="$date_sort"/>
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="format" select="$format"/>
<!--<xsl:with-param name="match" select=" 'text' "/>-->
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- CREATE THE DATE OPTIONS -->
<xsl:if test="not($pi_node_set)">
<xsl:variable name="blankValue">
<xsl:choose>
<xsl:when test="$date_part = 'Day'"><xsl:value-of select="$thisPI[@id=$attr_id]/DayInitialValue"/></xsl:when>
<xsl:when test="$date_part = 'Month'"><xsl:value-of select="$thisPI[@id=$attr_id]/MonthInitialValue"/></xsl:when>
<xsl:when test="$date_part = 'Year'"><xsl:value-of select="$thisPI[@id=$attr_id]/YearInitialValue"/></xsl:when>
<xsl:when test="$thisPage='PF'"></xsl:when>
<xsl:otherwise>--</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$thisPage='PF'"><option value="-24"><xsl:value-of select="$blankValue"/></option></xsl:when>
<xsl:otherwise><option value="-10"><xsl:value-of select="$blankValue"/></option></xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:call-template name="create_date_options">
<xsl:with-param name="attr_id" select="$attr_id"/>
<xsl:with-param name="default_val" select="$default_val"/>
<xsl:with-param name="primary_match" select="$primary_match"/>
<xsl:with-param name="date_text" select="$date_text"/>
<xsl:with-param name="delim" select=" ';' "/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
<!--This is for Value Carry Forward. If the value in the inputfield of this attribute is not present in the Years node set, then add it to the bottom of the dropdown and make it selected -->
<xsl:if test="$date_part='Year'">
<xsl:variable name="vcf_year" select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType='Y' and @rangeType=$range_type]/Value/Name"/>
<xsl:if test="contains($pi_node_set,$vcf_year)=false() and $vcf_year!='-24'">
<option value="{$returnAttr[@id=$attr_id]/InputFields/Input[@dataType='Y' and @rangeType=$range_type]/Value/Name}" selected="selected">
<xsl:value-of select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType='Y' and @rangeType=$range_type]/Value/Name"/>
</option>
</xsl:if>
</xsl:if>
</xsl:template>
<!--
<template name="create_date_options">
The template generates date HTML option elements from the provided strings of date parts
in three possible formats and based on user selelcted values and default.
<param name="default_val">Default value</param>
<param name="primary_match">Set of date parts (number format) arranged as a string of values with delimiters.</param>
<param name="date_text">Set of date parts (long format) arranged as a string of values with delimiters.</param>
<param name="delim">Delimiter string used</param>
</template>
-->
<xsl:template name="create_date_options">
<xsl:param name="attr_id"/>
<xsl:param name="default_val"/>
<xsl:param name="primary_match"/>
<xsl:param name="date_text"/>
<xsl:param name="delim" select=" ';' "/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<!-- GET THE NEXT SUBSTRING -->
<xsl:variable name="primary" select="substring-before($primary_match,$delim)"/>
<xsl:variable name="text" select="substring-before($date_text,$delim)"/>
<!-- WRITE THE OPTIONS -->
<xsl:choose>
<xsl:when test="$thisPage='PF'">
<option>
<xsl:attribute name="value"><xsl:choose><xsl:when test="$primary='--' or $primary='Any' or $primary=''">-24</xsl:when><xsl:otherwise><xsl:value-of select="$primary"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:if test="number($default_val) = number($primary)">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$text"/>
</option>
</xsl:when>
<xsl:otherwise>
<option>
<xsl:attribute name="value"><xsl:choose><xsl:when test="$primary='-' or $primary='--' or $primary='Any' or $primary=''">-10</xsl:when><xsl:otherwise><xsl:value-of select="$primary"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:if test="number($default_val) = number($primary)">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$text"/>
</option>
</xsl:otherwise>
</xsl:choose>
<!-- RECURSION, IF THERE ARE MORE SUBSTRINGS -->
<xsl:if test="string-length(substring-after($primary_match,$delim)) &gt; 0">
<xsl:call-template name="create_date_options">
<xsl:with-param name="attr_id" select="$attr_id"/>
<xsl:with-param name="default_val" select="$default_val"/>
<xsl:with-param name="primary_match" select="substring-after($primary_match,$delim)"/>
<xsl:with-param name="date_text" select="substring-after($date_text,$delim)"/>
<xsl:with-param name="delim" select="$delim"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!--
<template name="get_default_val">
The template generates the values that should be selected in the date option list based on user selections, current values and initial values.
<param required="true" name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="attr_id">Attribute id.</param>
<param name="range_type">Only needed for PF date ranges</param>
<param optional="true" name="FieldName">Field name only needed for SYI (to pull data from PostedFormFields section</param>
</template>
-->
<xsl:template name="get_default_val">
<xsl:param name="date_part"/>
<xsl:param name="attr_id"/>
<xsl:param name="range_type"/>
<xsl:param name="FieldName"/>
<xsl:param name="VCSID"/>
<xsl:variable name="pi" select="$thisPI[@id=$attr_id]"/>
<!-- GET THE POSSIBLE DEFAULT VALUES -->
<xsl:variable name="users_val">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:choose>
<xsl:when test="$UsePostedFormFields">
<xsl:value-of select="$FormFields/FormField[@name = $FieldName]/Value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$returnAttr[../@id=$VCSID and @id=$attr_id]/Value/*[name() = $date_part]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$subPage='API'">
<xsl:value-of select="$returnAttr[../@id=$VCSID and @id=$attr_id]/Value/*[name() = $date_part]"/>
</xsl:when>
<xsl:when test="$range_type!=''">
<xsl:value-of select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType=substring($date_part,1,1) and @rangeType=$range_type]/Value/Name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType=substring($date_part,1,1)]/Value/Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="current_val">
<xsl:if test="$pi/CurrentDate">
<xsl:call-template name="get_current_date_string">
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="date" select="$attrData[@id=$attr_id]/CurrentTime/DateMedium"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:variable name="initial_val">
<xsl:choose>
<xsl:when test="$date_part = 'Day'"><xsl:value-of select="$pi/DayInitialValue"/></xsl:when>
<xsl:when test="$date_part = 'Month'"><xsl:value-of select="$pi/MonthInitialValue"/></xsl:when>
<xsl:when test="$date_part = 'Year'"><xsl:value-of select="$pi/YearInitialValue"/></xsl:when>
</xsl:choose>
</xsl:variable>
<!-- RETURN THE RIGHT DEFAULT VALUE -->
<xsl:choose>
<xsl:when test="string-length($users_val) &gt; 0">
<xsl:value-of select="$users_val"/>
</xsl:when>
<xsl:when test="string-length($current_val) &gt; 0">
<xsl:value-of select="$current_val"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$initial_val"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
<template name="get_current_date_string">
The template generates part of the date based on passed parameters.
<param required="true" name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="date">The date delimited with '-'</param>
</template>
-->
<xsl:template name="get_current_date_string">
<xsl:param name="date_part"/>
<xsl:param name="date"/>
<xsl:variable name="month" select="substring-before($date,'-')"/>
<xsl:variable name="day_year" select="substring-after($date,'-')"/>
<xsl:variable name="day" select="substring-before($day_year,'-')"/>
<xsl:variable name="year" select="substring-after($day_year,'-')"/>
<xsl:choose>
<xsl:when test="$date_part = 'Day'"><xsl:value-of select="$day"/></xsl:when>
<xsl:when test="$date_part = 'Month'"><xsl:value-of select="$month"/></xsl:when>
<xsl:when test="$date_part = 'Year' and $year"><xsl:value-of select=" concat('20',$year) "/></xsl:when>
</xsl:choose>
</xsl:template>
<!--
<template name="get_date_strings">
The template returns the required one string of 10 possible date sets with values delimited with ';'
<param name="date_sort">
Specifies the sorting order and the format of the date part
<enum>
<enum>
<value>ascending<note>descending order</note></value>
<value>descending<note>ascending order</note></value>
</enum>
</enum>
</param>
<param required="true" name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="match">
Specifies the format of the date value set to return
<enum>
<values>primary<note>specifies number format, i.e. date part will be returned as a number</note></values>
<values>secondary<note>specifies number format, i.e. date part will be returned as a number</note></values>
<values>text<note>specifies number format, i.e. date part will be returned as a number</note></values>
</enum>
</param>
</template>
-->
<xsl:template name="get_date_strings">
<xsl:param name="format"/>
<xsl:param name="date_sort"/>
<xsl:param name="date_part"/>
<xsl:param name="match"/>
<!-- ALL THE POSSIBLE DATE STRINGS -->
<xsl:variable name="day_ascending">01;02;03;04;05;06;07;08;09;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;</xsl:variable>
<xsl:variable name="day_descending">31;30;29;28;27;26;25;24;23;22;21;20;19;18;17;16;15;14;13;12;11;10;09;08;07;06;05;04;03;02;01;</xsl:variable>
<xsl:variable name="month_ascending_short">Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;</xsl:variable>
<xsl:variable name="month_descending_short">Dec;Nov;Oct;Sep;Aug;Jul;Jun;May;Apr;Mar;Feb;Jan;</xsl:variable>
<!--
<xsl:variable name="month_ascending_long">January;February;March;April;May;June;July;August;September;October;November;December;</xsl:variable>
<xsl:variable name="month_descending_long">December;November;October;September;August;July;June;May;April;March;February;January;</xsl:variable>
-->
<xsl:variable name="month_ascending_number">01;02;03;04;05;06;07;08;09;10;11;12;</xsl:variable>
<xsl:variable name="month_descending_number">12;11;10;09;08;07;06;05;04;03;02;01;</xsl:variable>
<!--<xsl:variable name="year_ascending">2001;2002;2003;2004;2005;2006;</xsl:variable>
<xsl:variable name="year_descending">2006;2005;2004;2003;2002;2001;</xsl:variable>-->
<!-- LOGIC FOR RETURNING DATE STRINGS -->
<xsl:choose>
<xsl:when test=" $date_part = 'Day' ">
<xsl:choose>
<xsl:when test=" $date_sort = 'descending' ">
<xsl:value-of select="$day_descending"/>
</xsl:when>
<xsl:when test=" $date_sort = 'ascending' ">
<xsl:value-of select="$day_ascending"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_part = 'Month' ">
<xsl:choose>
<xsl:when test="($date_sort = 'ascending') and contains($format,'M')">
<xsl:call-template name="month_ascending_short"/>
</xsl:when>
<xsl:when test="($date_sort = 'descending') and contains($format,'M')">
<xsl:call-template name="month_descending_short"/>
</xsl:when>
<xsl:when test="($date_sort = 'ascending') and $match = 'primary' ">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
<xsl:when test="($date_sort = 'descending') and $match = 'primary' ">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
<!--<xsl:when test=" $date_sort = 'MonthAscendingLong' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:call-template name="month_ascending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:call-template name="month_ascending_long"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_sort = 'MonthDescendingLong' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:call-template name="month_descending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:call-template name="month_descending_long"/>
</xsl:when>
</xsl:choose>
</xsl:when>-->
<xsl:when test="($date_sort = 'ascending') and contains($format,'m')">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
<xsl:when test="($date_sort = 'descending') and contains($format,'m')">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
<!--<xsl:when test="($date_sort = 'ascending') and $match = 'text'">
<xsl:value-of select="$month_ascending_short"/>
</xsl:when>
<xsl:when test="($date_sort = 'descending') and $match = 'text'">
<xsl:value-of select="$month_descending_short"/>
</xsl:when>-->
</xsl:choose>
</xsl:when>
<!--<xsl:when test=" $date_part = 'Year' ">
<xsl:choose>
<xsl:when test=" $date_sort = 'YearDescending' ">
<xsl:value-of select="$year_descending"/>
</xsl:when>
<xsl:when test=" $date_sort = 'YearAscending' ">
<xsl:value-of select="$year_ascending"/>
</xsl:when>
</xsl:choose>
</xsl:when>-->
</xsl:choose>
</xsl:template>
<xsl:template name="month_ascending_short">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthAscendingShort"><xsl:value-of select="/eBay/GlobalSettings/MonthAscendingShort"/></xsl:when>
<xsl:otherwise>Jan<xsl:value-of select="';'"/>Feb<xsl:value-of select="';'"/>Mar<xsl:value-of select="';'"/>Apr<xsl:value-of select="';'"/>May<xsl:value-of select="';'"/>Jun<xsl:value-of select="';'"/>Jul<xsl:value-of select="';'"/>Aug<xsl:value-of select="';'"/>Sep<xsl:value-of select="';'"/>Oct<xsl:value-of select="';'"/>Nov<xsl:value-of select="';'"/>Dec<xsl:value-of select="';'"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="month_descending_short">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthDescendingShort "><xsl:value-of select="/eBay/GlobalSettings/MonthDescendingShort"/></xsl:when>
<xsl:otherwise>Dec<xsl:value-of select="';'"/>Nov<xsl:value-of select="';'"/>Oct<xsl:value-of select="';'"/>Sep<xsl:value-of select="';'"/>Aug<xsl:value-of select="';'"/>Jul<xsl:value-of select="';'"/>Jun<xsl:value-of select="';'"/>May<xsl:value-of select="';'"/>Apr<xsl:value-of select="';'"/>Mar<xsl:value-of select="';'"/>Feb<xsl:value-of select="';'"/>Jan<xsl:value-of select="';'"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="month_ascending_long">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthDescendingLong"><xsl:value-of select="/eBay/GlobalSettings/MonthDescendingShort"/></xsl:when>
<xsl:otherwise>January<xsl:value-of select="';'"/>February<xsl:value-of select="';'"/>March<xsl:value-of select="';'"/>April<xsl:value-of select="';'"/>May<xsl:value-of select="';'"/>June<xsl:value-of select="';'"/>July<xsl:value-of select="';'"/>August<xsl:value-of select="';'"/>September<xsl:value-of select="';'"/>October<xsl:value-of select="';'"/>November<xsl:value-of select="';'"/>December<xsl:value-of select="';'"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="month_descending_long">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthDescendingLong"><xsl:value-of select="/eBay/GlobalSettings/MonthDescendingShort"/></xsl:when>
<xsl:otherwise>December<xsl:value-of select="';'"/>November<xsl:value-of select="';'"/>October<xsl:value-of select="';'"/>September<xsl:value-of select="';'"/>August<xsl:value-of select="';'"/>July<xsl:value-of select="';'"/>June<xsl:value-of select="';'"/>May<xsl:value-of select="';'"/>April<xsl:value-of select="';'"/>March<xsl:value-of select="';'"/>February<xsl:value-of select="';'"/>January<xsl:value-of select="';'"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- DEBUG INFO: End build include: ..\XSL\en-US\Global\shared/attr_dates.xsl -->
<!-- DEBUG INFO: Start build include: -->
<!--
<template name="date_options_old">
The template is to generate a HTML option elements for the specified part of the date.
<param name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="attr_id">Attribute id</param>
<param name="date_sort">
Specifies the sorting order and the format of the date part
<enum>
<value>DayDescending<note>days - descending order</note></value>
<value>DayAscending<note>days - ascending order</note></value>
<value>MonthAscendingShort<note>month short format (i.e. Jun) - ascending order</note></value>
<value>MonthDescendingShort<note>month short format - descending order</note></value>
<value>MonthAscendingLong<note>month long format (January) - ascending order</note></value>
<value>MonthDescendingLong<note>month long format - descending order</note></value>
<value>MonthAscendingNumber<note>month number format (01) - ascending order</note></value>
<value>MonthDescendingNumber<note>month number format (01) - descending order</note></value>
<value>YearDescending<note>year - descending order</note></value>
<value>YearAscending<note>year - descending order</note></value>
</enum>
</param>
<param name="pi_node_set">Options definded in the Presentation Instructions</param>
<param optional="true" name="range_type">Only needed for PF date ranges</param>
<param optional="true" name="FieldName">Field name only needed for SYI (to pull data from PostedFormFields section</param>
</template>
-->
<xsl:template name="date_options_old">
<xsl:param name="date_part"/>
<!-- REQUIRED: 'Day' | 'Month' | 'Year' -->
<xsl:param name="attr_id"/>
<!-- REQUIRED -->
<xsl:param name="date_sort"/>
<!-- REQUIRED FOR DAYS AND MONTHS: 'DayAscending' | 'DayDescending' | ... etc ... -->
<xsl:param name="pi_node_set"/>
<!-- REQUIRED FOR YEARS: options definded in the PI -->
<xsl:param name="range_type"/>
<!-- OPTIONAL: only needed for PF date ranges -->
<xsl:param name="FieldName"/>
<!-- OPTIONAL: only needed for SYI (to pull data from PostedFormFields section -->
<xsl:param name="SelectedAttributeXPath"/>
<!-- OPTIONAL: Needed for SYI when Listing in 2 categories -->
<xsl:param name="VCSID"/>
<!-- GET THE DEFAULT DATE -->
<xsl:variable name="default_val">
<xsl:call-template name="get_default_val_old">
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="attr_id" select="$attr_id"/>
<xsl:with-param name="range_type" select="$range_type"/>
<xsl:with-param name="FieldName" select="$FieldName"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
</xsl:call-template>
</xsl:variable>
<!-- GET SPECIFIC DATE STRINGS -->
<xsl:variable name="primary_match">
<xsl:choose>
<xsl:when test="$pi_node_set">
<xsl:value-of select="$pi_node_set"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="get_date_strings_old">
<xsl:with-param name="date_sort" select="$date_sort"/>
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="match" select=" 'primary' "/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="secondary_match">
<xsl:choose>
<xsl:when test="$pi_node_set">
<xsl:value-of select="$pi_node_set"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="get_date_strings_old">
<xsl:with-param name="date_sort" select="$date_sort"/>
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="match" select=" 'secondary' "/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="date_text">
<xsl:choose>
<xsl:when test="$pi_node_set">
<xsl:value-of select="$pi_node_set"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="get_date_strings_old">
<xsl:with-param name="date_sort" select="$date_sort"/>
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="match" select=" 'text' "/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- CREATE THE DATE OPTIONS -->
<xsl:if test="not($pi_node_set)">
<xsl:choose>
<xsl:when test="$thisPage='PF'">
<option value="-24"/>
</xsl:when>
<xsl:otherwise>
<option value="-10">--</option>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:call-template name="create_date_options_old">
<xsl:with-param name="attr_id" select="$attr_id"/>
<xsl:with-param name="default_val" select="$default_val"/>
<xsl:with-param name="primary_match" select="$primary_match"/>
<xsl:with-param name="secondary_match" select="$secondary_match"/>
<xsl:with-param name="date_text" select="$date_text"/>
<xsl:with-param name="delim" select=" ';' "/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
<!--This is for Value Carry Forward. If the value in the inputfield of this attribute is not present in the Years node set, then add it to the bottom of the dropdown and make it selected -->
<xsl:if test="$date_part='Year'">
<xsl:variable name="vcf_year" select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType='Y' and @rangeType=$range_type]/Value/Name"/>
<xsl:if test="contains($pi_node_set,$vcf_year)=false() and $vcf_year!='-24'">
<option value="{$returnAttr[@id=$attr_id]/InputFields/Input[@dataType='Y' and @rangeType=$range_type]/Value/Name}" selected="selected">
<xsl:value-of select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType='Y' and @rangeType=$range_type]/Value/Name"/>
</option>
</xsl:if>
</xsl:if>
</xsl:template>
<!--
<template name="create_date_options_old">
The template generates date HTML option elements from the provided strings of date parts
in three possible formats and based on user selelcted values and default.
<param name="default_val">Default value</param>
<param name="primary_match">Set of date parts (number format) arranged as a string of values with delimiters.</param>
<param name="secondary_match">Set of date parts (short format) arranged as a string of values with delimiters.</param>
<param name="date_text">Set of date parts (long format) arranged as a string of values with delimiters.</param>
<param name="delim">Delimiter string used</param>
</template>
-->
<xsl:template name="create_date_options_old">
<xsl:param name="attr_id"/>
<xsl:param name="default_val"/>
<xsl:param name="primary_match"/>
<xsl:param name="secondary_match"/>
<xsl:param name="date_text"/>
<xsl:param name="delim" select=" ';' "/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<!-- GET THE NEXT SUBSTRING -->
<xsl:variable name="primary" select="substring-before($primary_match,$delim)"/>
<xsl:variable name="secondary" select="substring-before($secondary_match,$delim)"/>
<xsl:variable name="text" select="substring-before($date_text,$delim)"/>
<!-- WRITE THE OPTIONS -->
<xsl:choose>
<xsl:when test="$thisPage='PF'">
<option>
<xsl:attribute name="value"><xsl:choose><xsl:when test="$primary='--' or $primary='Any' or $primary=''">-24</xsl:when><xsl:otherwise><xsl:value-of select="$primary"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:if test="number($default_val) = number($primary) or number($default_val) = number($secondary)">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$text"/>
</option>
</xsl:when>
<xsl:otherwise>
<option>
<xsl:attribute name="value"><xsl:choose><xsl:when test="$primary='--' or $primary='Any' or $primary=''">-10</xsl:when><xsl:otherwise><xsl:value-of select="$primary"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:if test="(number($default_val) = number($primary) or number($default_val) = number($secondary)) and $SelectedAttributeXPath[@id=$attr_id]">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$text"/>
</option>
</xsl:otherwise>
</xsl:choose>
<!-- RECURSION, IF THERE ARE MORE SUBSTRINGS -->
<xsl:if test="string-length(substring-after($primary_match,$delim)) &gt; 0">
<xsl:call-template name="create_date_options_old">
<xsl:with-param name="attr_id" select="$attr_id"/>
<xsl:with-param name="default_val" select="$default_val"/>
<xsl:with-param name="primary_match" select="substring-after($primary_match,$delim)"/>
<xsl:with-param name="secondary_match" select="substring-after($secondary_match,$delim)"/>
<xsl:with-param name="date_text" select="substring-after($date_text,$delim)"/>
<xsl:with-param name="delim" select="$delim"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!--
<template name="get_default_val_old">
The template generates the values that should be selected in the date option list based on user selections, current values and initial values.
<param required="true" name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="attr_id">Attribute id.</param>
<param name="range_type">Only needed for PF date ranges</param>
<param optional="true" name="FieldName">Field name only needed for SYI (to pull data from PostedFormFields section</param>
</template>
-->
<xsl:template name="get_default_val_old">
<xsl:param name="date_part"/>
<xsl:param name="attr_id"/>
<xsl:param name="range_type"/>
<xsl:param name="FieldName"/>
<xsl:param name="VCSID"/>
<xsl:variable name="pi" select="$thisPI[@id=$attr_id]"/>
<!-- GET THE POSSIBLE DEFAULT VALUES -->
<xsl:variable name="users_val">
<xsl:choose>
<xsl:when test="$thisPage!='PF'">
<xsl:choose>
<xsl:when test="$UsePostedFormFields">
<xsl:value-of select="$FormFields/FormField[@name = $FieldName]/Value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$returnAttr[@id=$attr_id and ../@id=$VCSID]/Value/*[name() = $date_part]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$subPage='API'">
<xsl:value-of select="$returnAttr[@id=$attr_id]/Value/*[name() = $date_part]"/>
</xsl:when>
<xsl:when test="$range_type!=''">
<xsl:value-of select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType=substring($date_part,1,1) and @rangeType=$range_type]/Value/Name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$returnAttr[@id=$attr_id]/InputFields/Input[@dataType=substring($date_part,1,1)]/Value/Name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="current_val">
<xsl:if test="$pi/CurrentDate">
<xsl:call-template name="get_current_date_string_old">
<xsl:with-param name="date_part" select="$date_part"/>
<xsl:with-param name="date" select="$attrData[@id=$attr_id]/CurrentTime/DateMedium"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:variable name="initial_val">
<xsl:choose>
<xsl:when test="$date_part = 'Day'">
<xsl:value-of select="$pi/DayInitialValue"/>
</xsl:when>
<xsl:when test="$date_part = 'Month'">
<xsl:value-of select="$pi/MonthInitialValue"/>
</xsl:when>
<xsl:when test="$date_part = 'Year'">
<xsl:value-of select="$pi/YearInitialValue"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<!-- RETURN THE RIGHT DEFAULT VALUE -->
<xsl:choose>
<xsl:when test="string-length($users_val) &gt; 0">
<xsl:value-of select="$users_val"/>
</xsl:when>
<xsl:when test="string-length($current_val) &gt; 0">
<xsl:value-of select="$current_val"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$initial_val"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
<template name="get_current_date_string_old">
The template generates part of the date based on passed parameters.
<param required="true" name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="date">The date delimited with '-'</param>
</template>
-->
<xsl:template name="get_current_date_string_old">
<xsl:param name="date_part"/>
<xsl:param name="date"/>
<xsl:variable name="month" select="substring-before($date,'-')"/>
<xsl:variable name="day_year" select="substring-after($date,'-')"/>
<xsl:variable name="day" select="substring-before($day_year,'-')"/>
<xsl:variable name="year" select="substring-after($day_year,'-')"/>
<xsl:choose>
<xsl:when test="$date_part = 'Day'">
<xsl:value-of select="$day"/>
</xsl:when>
<xsl:when test="$date_part = 'Month'">
<xsl:value-of select="$month"/>
</xsl:when>
<xsl:when test="$date_part = 'Year' and $year">
<xsl:value-of select=" concat('20',$year) "/>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--
<template name="get_date_strings_old">
The template returns the required one string of 10 possible date sets with values delimited with ';'
<param name="date_sort">
Specifies the sorting order and the format of the date part
<enum>
<value>DayDescending<note>days - descending order</note></value>
<value>DayAscending<note>days - ascending order</note></value>
<value>MonthAscendingShort<note>month short format (i.e. Jun) - ascending order</note></value>
<value>MonthDescendingShort<note>month short format - descending order</note></value>
<value>MonthAscendingLong<note>month long format (January) - ascending order</note></value>
<value>MonthDescendingLong<note>month long format - descending order</note></value>
<value>MonthAscendingNumber<note>month number format (01) - ascending order</note></value>
<value>MonthDescendingNumber<note>month number format (01) - descending order</note></value>
<value>YearDescending<note>year - descending order</note></value>
<value>YearAscending<note>year - descending order</note></value>
</enum>
</param>
<param required="true" name="date_part">
Specifies the part of date to generate option list for
<enum>
<value>Day<note>specifies to generate the day of the month</note></value>
<value>Month<note>specifies to generate month</note></value>
<value>Year<note>specifies to generate year</note></value>
</enum>
</param>
<param name="match">
Specifies the format of the date value set to return
<enum>
<values>primary<note>specifies number format, i.e. date part will be returned as a number</note></values>
<values>secondary<note>specifies number format, i.e. date part will be returned as a number</note></values>
<values>text<note>specifies number format, i.e. date part will be returned as a number</note></values>
</enum>
</param>
</template>
-->
<xsl:template name="get_date_strings_old">
<xsl:param name="date_sort"/>
<xsl:param name="date_part"/>
<xsl:param name="match"/>
<!-- ALL THE POSSIBLE DATE STRINGS -->
<xsl:variable name="day_ascending">01;02;03;04;05;06;07;08;09;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;</xsl:variable>
<xsl:variable name="day_descending">31;30;29;28;27;26;25;24;23;22;21;20;19;18;17;16;15;14;13;12;11;10;09;08;07;06;05;04;03;02;01;</xsl:variable>
<xsl:variable name="month_ascending_short">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthAscendingShort"><xsl:value-of select="/eBay/GlobalSettings/MonthAscendingShort"/></xsl:when>
<xsl:otherwise>Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="month_descending_short">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthDescendingShort"><xsl:value-of select="/eBay/GlobalSettings/MonthDescendingShort"/></xsl:when>
<xsl:otherwise>Dec;Nov;Oct;Sep;Aug;Jul;Jun;May;Apr;Mar;Feb;Jan;</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="month_ascending_long">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthAscendingLong"><xsl:value-of select="/eBay/GlobalSettings/MonthAscendingLong"/></xsl:when>
<xsl:otherwise>Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="month_descending_long">
<xsl:choose>
<xsl:when test="$subPage = 'API' and /eBay/GlobalSettings/MonthDescendingLong"><xsl:value-of select="/eBay/GlobalSettings/MonthDescendingLong"/></xsl:when>
<xsl:otherwise>Dec;Nov;Oct;Sep;Aug;Jul;Jun;May;Apr;Mar;Feb;Jan;</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="month_ascending_number">01;02;03;04;05;06;07;08;09;10;11;12;</xsl:variable>
<xsl:variable name="month_descending_number">12;11;10;09;08;07;06;05;04;03;02;01;</xsl:variable>
<xsl:variable name="year_ascending">2001;2002;2003;2004;2005;2006;</xsl:variable>
<xsl:variable name="year_descending">2006;2005;2004;2003;2002;2001;</xsl:variable>
<!-- LOGIC FOR RETURNING DATE STRINGS -->
<xsl:choose>
<xsl:when test=" $date_part = 'Day' ">
<xsl:choose>
<xsl:when test=" $date_sort = 'DayDescending' ">
<xsl:value-of select="$day_descending"/>
</xsl:when>
<xsl:when test=" $date_sort = 'DayAscending' ">
<xsl:value-of select="$day_ascending"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_part = 'Month' ">
<xsl:choose>
<xsl:when test=" $date_sort = 'MonthAscendingShort' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:value-of select="$month_ascending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:value-of select="$month_ascending_short"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_sort = 'MonthDescendingShort' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:value-of select="$month_descending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:value-of select="$month_descending_short"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_sort = 'MonthAscendingLong' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:value-of select="$month_ascending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:value-of select="$month_ascending_long"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_sort = 'MonthDescendingLong' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:value-of select="$month_descending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:value-of select="$month_descending_long"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_sort = 'MonthAscendingNumber' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:value-of select="$month_ascending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:value-of select="$month_ascending_number"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_sort = 'MonthDescendingNumber' ">
<xsl:choose>
<xsl:when test=" $match = 'primary' ">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
<xsl:when test=" $match = 'secondary' ">
<xsl:value-of select="$month_descending_short"/>
</xsl:when>
<xsl:when test=" $match = 'text' ">
<xsl:value-of select="$month_descending_number"/>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test=" $date_part = 'Year' ">
<xsl:choose>
<xsl:when test=" $date_sort = 'YearDescending' ">
<xsl:value-of select="$year_descending"/>
</xsl:when>
<xsl:when test=" $date_sort = 'YearAscending' ">
<xsl:value-of select="$year_ascending"/>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- DEBUG INFO: End build include: ..\XSL\en-US\Global\shared/attr_dates_old.xsl -->
<!-- DEBUG INFO: Start build include: -->
<!--
<template name="DateLabels">
The template is to generate date labels based on format provided..
<param name="attrId">Attribute id</param>
<param name="format">Date format<note>example: m_d_y</note></param>
<param name="quadrant">Location relatively to the field</param>
</template>
-->
<xsl:template name="DateLabels">
<xsl:param name="attrId"/>
<xsl:param name="format"/>
<xsl:param name="quadrant"/>
<xsl:if test="string-length($format) &gt; 0">
<xsl:variable name="char" select="substring($format,1,1)"/>
<xsl:choose>
<xsl:when test="$char='Y' or $char='y'"><!--remove 'y' when phase b is stable-->
<td/>
<td valign="top">
<xsl:if test="../Year/@quadrant = $quadrant">
<font face="{../Year/@face}" size="{../Year/@size}">
<xsl:value-of select="../Year"/>
</font>
</xsl:if>
</td>
<td/>
</xsl:when>
<xsl:when test="$char='m' or $char='M'">
<td/>
<td valign="top">
<xsl:if test="../Month/@quadrant = $quadrant">
<font face="{../Month/@face}" size="{../Month/@size}">
<xsl:value-of select="../Month"/>
</font>
</xsl:if>
</td>
<td/>
</xsl:when>
<xsl:when test="$char='d'">
<td/>
<td valign="top">
<xsl:if test="../Day/@quadrant = $quadrant">
<font face="{../Day/@face}" size="{../Day/@size}">
<xsl:value-of select="../Day"/>
</font>
</xsl:if>
</td>
<td/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="DateLabels">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="format">
<xsl:value-of select="substring($format,2)"/>
</xsl:with-param>
<xsl:with-param name="quadrant">
<xsl:value-of select="$quadrant"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!--
<template name="DateDropdowns">
The template is to generate date attribute as a dropdown box.
<param name="attrId">Attribute id</param>
<param name="inputName">Name of the input box that.</param>
<param name="format">Date format<note>example: m_d_y</note></param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
</template>
-->
<xsl:template name="DateDropdowns">
<xsl:param name="attrId"/>
<xsl:param name="inputName"/>
<xsl:param name="format"/>
<xsl:param name="VCSID"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:if test="string-length($format) &gt; 0">
<xsl:variable name="char" select="substring($format,1,1)"/>
<xsl:choose>
<xsl:when test="$char='Y' or $char='y'"><!--remove 'y' when phase b is stable-->
<td valign="middle">
<xsl:if test="../Year/@quadrant = 'left'">
<font face="{../Year/@face}" size="{../Year/@size}">
<xsl:value-of select="../Year"/>
</font>
</xsl:if>
</td>
<td valign="middle">
<select>
<xsl:variable name="FieldNameY" select="concat('attr_d',$VCSID,'_',$attrId,'_y')"/>
<xsl:attribute name="class"><xsl:choose><xsl:when test="$thisPage='PF'"><xsl:value-of select="$inputName"/></xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
<xsl:attribute name="name"><xsl:choose><xsl:when test="$thisPage='SYI'"><xsl:value-of select="$FieldNameY"/></xsl:when><xsl:otherwise><xsl:value-of select="$inputName"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:choose>
<xsl:when test="@format">
<xsl:call-template name="date_options_old"><!--dt:removed this template when phase b is stable-->
<xsl:with-param name="attr_id" select="$attrId"/>
<xsl:with-param name="date_part" select=" 'Year' "/>
<xsl:with-param name="pi_node_set">
<xsl:for-each select="../Years"><xsl:value-of select="."/><xsl:text>;</xsl:text></xsl:for-each>
</xsl:with-param>
<xsl:with-param name="FieldName" select="$FieldNameY"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="date_options">
<xsl:with-param name="attr_id" select="$attrId"/>
<xsl:with-param name="date_part" select=" 'Year' "/>
<xsl:with-param name="pi_node_set">
<xsl:for-each select="$CurrentAttributeXPath[@id=$attrId]/ValueList/Value"><xsl:value-of select="Name"/><xsl:text>;</xsl:text></xsl:for-each>
</xsl:with-param>
<xsl:with-param name="FieldName" select="$FieldNameY"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</select>&#160;
</td>
<td valign="middle">
<xsl:if test="../Year/@quadrant = 'right'">
<font face="{../Year/@face}" size="{../Year/@size}">
<xsl:value-of select="../Year"/>
</font>
</xsl:if>
</td>
</xsl:when>
<xsl:when test="$char='m' or $char='M'">
<td valign="middle">
<xsl:if test="../Month/@quadrant = 'left'">
<font face="{../Month/@face}" size="{../Month/@size}">
<xsl:value-of select="../Month"/>
</font>
</xsl:if>
</td>
<td valign="middle">
<select>
<xsl:variable name="FieldNameM" select="concat('attr_d',$VCSID,'_',$attrId,'_m')"/>
<xsl:attribute name="class"><xsl:choose><xsl:when test="$thisPage='PF'"><xsl:value-of select="$inputName"/></xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
<xsl:attribute name="name"><xsl:choose><xsl:when test="$thisPage='SYI'"><xsl:value-of select="$FieldNameM"/></xsl:when><xsl:otherwise><xsl:value-of select="$inputName"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:choose>
<xsl:when test="@format"><!--dt:removed this template when phase b is stable-->
<xsl:call-template name="date_options_old">
<xsl:with-param name="attr_id" select="$attrId"/>
<xsl:with-param name="date_part" select=" 'Month' "/>
<xsl:with-param name="date_sort" select=" name(../*[ (string-length(name()) &gt; 5) and contains(name(), 'Month') and not(contains(name(), 'Initial')) ])"/>
<xsl:with-param name="FieldName" select="$FieldNameM"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><!--dt:removed this template when phase b is stable-->
<xsl:call-template name="date_options">
<xsl:with-param name="attr_id" select="$attrId"/>
<xsl:with-param name="date_part" select=" 'Month' "/>
<xsl:with-param name="date_sort" select="../Month/@sort"/>
<xsl:with-param name="format" select="$format"/>
<xsl:with-param name="FieldName" select="$FieldNameM"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</select>&#160;
</td>
<td valign="middle">
<xsl:if test="../Month/@quadrant = 'right'">
<font face="{../Month/@face}" size="{../Month/@size}">
<xsl:value-of select="../Month"/>
</font>
</xsl:if>
</td>
</xsl:when>
<xsl:when test="$char='d'">
<td valign="middle">
<xsl:if test="../Day/@quadrant = 'left'">
<font face="{../Day/@face}" size="{../Day/@size}">
<xsl:value-of select="../Day"/>
</font>
</xsl:if>
</td>
<td valign="middle">
<select>
<xsl:variable name="FieldNameD" select="concat('attr_d',$VCSID,'_',$attrId,'_d')"/>
<xsl:attribute name="class"><xsl:choose><xsl:when test="$thisPage='PF'"><xsl:value-of select="$inputName"/></xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
<xsl:attribute name="name"><xsl:choose><xsl:when test="$thisPage='SYI'"><xsl:value-of select="$FieldNameD"/></xsl:when><xsl:otherwise><xsl:value-of select="$inputName"/></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:choose>
<xsl:when test="@format"><!--dt:removed this template when phase b is stable-->
<xsl:call-template name="date_options_old">
<xsl:with-param name="attr_id" select="$attrId"/>
<xsl:with-param name="date_part" select=" 'Day' "/>
<xsl:with-param name="date_sort" select=" name(../*[ (string-length(name()) &gt; 3) and contains(name(), 'Day') and not(contains(name(), 'Initial'))])"/>
<xsl:with-param name="FieldName" select="$FieldNameD"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><!--dt:removed this template when phase b is stable-->
<xsl:call-template name="date_options">
<xsl:with-param name="attr_id" select="$attrId"/>
<xsl:with-param name="date_part" select=" 'Day' "/>
<xsl:with-param name="date_sort" select="../Day/@sort"/>
<xsl:with-param name="FieldName" select="$FieldNameD"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</select>&#160;
</td>
<td valign="middle">
<xsl:if test="../Day/@quadrant = 'right'">
<font face="{../Day/@face}" size="{../Day/@size}">
<xsl:value-of select="../Day"/>
</font>
</xsl:if>
</td>
</xsl:when>
</xsl:choose>
<xsl:call-template name="DateDropdowns">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="inputName" select="$inputName"/>
<xsl:with-param name="format">
<xsl:value-of select="substring($format,2)"/>
</xsl:with-param>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!--
<template name="Dropdown">
The template is to generate attribute as a dropdown box.
<param name="attrId">Attribute id</param>
<param name="inputName">Name of the input box that.</param>
<param name="CurrentAttributeXPath">Current set of attributes based on characteristics set ID being parsed</param>
<param name="SelectedAttributeXPath">Selected attributes from the previous step based on the current characteristics set ID</param>
<param name="VCSID">characteristics set ID of the current category being handled</param>
</template>
-->
<xsl:template name="Dropdown">
<xsl:param name="attrId"/>
<xsl:param name="inputName"/>
<xsl:param name="SelectedAttributeXPath"/>
<xsl:param name="CurrentAttributeXPath"/>
<xsl:param name="VCSID"/>
<xsl:variable name="parentAttrId" select="$CurrentAttributeXPath[Dependency/@childAttrId=$attrId]/@id"/>
<xsl:choose>
<xsl:when test="../../@type='date'">
<xsl:variable name="format">
<xsl:choose>
<xsl:when test="@format">
<xsl:value-of select="@format"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$CurrentAttributeXPath[@id=$attrId]/@dateFormat"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- JO: BUGDB00116454 need to indent if there is text for Day, Month, Year labels -->
<xsl:variable name="isIndent" select="boolean((../Day and ../Day != '') or (../Month and ../Month != '') or (../Year and ../Year != ''))"/>
<table cellpadding="0" cellspacing="0" border="0" summary="">
<xsl:if test="../*/@quadrant='top'">
<tr>
<xsl:if test="$isIndent = true()"><td>&#160;</td></xsl:if>
<xsl:call-template name="DateLabels">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="format" select="$format"/>
<xsl:with-param name="quadrant">top</xsl:with-param>
</xsl:call-template>
</tr>
</xsl:if>
<tr>
<xsl:if test="$isIndent = true()"><td>&#160;</td></xsl:if>
<xsl:call-template name="DateDropdowns">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="inputName" select="$inputName"/>
<xsl:with-param name="format" select="$format"/>
<xsl:with-param name="VCSID" select="$VCSID"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="CurrentAttributeXPath" select="$CurrentAttributeXPath"/>
</xsl:call-template>
</tr>
<xsl:if test="../*/@quadrant='bottom'">
<tr>
<xsl:if test="$isIndent = true()"><td>&#160;</td></xsl:if>
<xsl:call-template name="DateLabels">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="format" select="$format"/>
<xsl:with-param name="quadrant">bottom</xsl:with-param>
</xsl:call-template>
</tr>
</xsl:if>
</table>
</xsl:when>
<xsl:otherwise>
<!--DT...this needs to be refactored more when dependencies between syi and pf are made more consistent -->
<xsl:choose>
<xsl:when test="$thisPage='SYI'">
<select>
<xsl:choose>
<!-- JO: commented out Post for type 4 because conditionally visible attributes are moved over to next page (multi-page flow). -->
<!--
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='4' or (@type='3' and @type='4')]">
<xsl:attribute name="onChange">aus_set_parent('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>', this.value); vvsp_check('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>', this.value);</xsl:attribute>
</xsl:when>
-->
<xsl:when test="$subPage = 'API' and $CurrentAttributeXPath[@id=$attrId]/Dependency[@type = '4' or @type = '5']">
<xsl:attribute name="onChange"><xsl:if test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='1']">attr_onchange('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>'); </xsl:if> vvsp_check('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>', this.value);</xsl:attribute>
</xsl:when>
<!-- DT: Type=3 (VVSP) no longer exist-->
<!--
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='3']">
<xsl:attribute name="onChange">aus_set_parent('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>',1); vvsp_post('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>', this.value);</xsl:attribute>
</xsl:when>
-->
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='1']">
<xsl:attribute name="onChange">attr_onchange('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>');<xsl:if test="$subPage = 'API' ">api_check_on_other('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>',this.value);</xsl:if></xsl:attribute>
</xsl:when>
<xsl:when test="$CurrentAttributeXPath[@id=$attrId]/Dependency[@type='2']">
<xsl:attribute name="onChange">attr_onchange('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>',this.options[this.selectedIndex].value);<xsl:if test="$subPage = 'API' ">api_check_on_other('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>',this.value);</xsl:if></xsl:attribute>
</xsl:when>
<xsl:when test="$subPage = 'API' ">
<xsl:attribute name="onChange">api_check_on_other('attr<xsl:value-of select="concat($VCSID,'_',$attrId)"/>',this.value);</xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:variable name="FieldName" select="concat('attr',$VCSID,'_',$attrId)"/>
<xsl:attribute name="name"><xsl:value-of select="$FieldName"/></xsl:attribute>
<xsl:choose>
<xsl:when test="$parentAttrId">
<xsl:choose>
<xsl:when test="$CurrentAttributeXPath[@id=$parentAttrId]/*[@isVisible='true']">
<xsl:apply-templates select="$CurrentAttributeXPath[@id=$parentAttrId]/Dependency[(@type='1' or @type='2') and @childAttrId=$attrId and @isVisible='true']" mode="isVisible">
<xsl:with-param name="attrId" select="$attrId"/>
</xsl:apply-templates>
<xsl:apply-templates select="$CurrentAttributeXPath[@id=$parentAttrId]/Dependency[(@type='1' or @type='2') and @childAttrId=$attrId and @isVisible='true']" mode="isVisible">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="FieldName" select="$FieldName"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="ParentFieldName">
<xsl:if test="$UsePostedFormFields">
<xsl:value-of select="concat('attr',$VCSID,'_',$parentAttrId)"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="SelectedParentValueId" select="$FormFields/FormField[$ParentFieldName!='' and @name = $ParentFieldName]/Value | $SelectedAttributeXPath[@id=$parentAttrId]/Value/@id"/>
<xsl:variable name="syiParentValueId" select="$SelectedParentValueId | $CurrentAttributeXPath[not($SelectedParentValueId) and @id=$parentAttrId]/ValueList/Value[1]/@id"/>
<xsl:choose>
<xsl:when test="$subPage='API' and $CurrentAttributeXPath[@id=$parentAttrId]/Dependency[(@type='3' or @type='4' or @type='5') and @parentValueId=$syiParentValueId and @childAttrId=$attrId]">
<xsl:variable name="values" select="$CurrentAttributeXPath[@id=$attrId]/ValueList/Value | $CurrentAttributeXPath[@id=$parentAttrId]/Dependency[@parentValueId=$syiParentValueId and @childAttrId=$attrId]/Value[count(. | key('attrByIDs', concat($VCSID, '_', key('selectedAttrByIDs', concat($VCSID, '_', $parentAttrId, '_', $syiParentValueId))/@id, '_', @id))[1])=1]"/>
<xsl:apply-templates select="$values">
<xsl:sort select="@id"/>
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="FieldName" select="$FieldName"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($SelectedParentValueId = '-10') or (not($SelectedParentValueId) and ($CurrentAttributeXPath[@id=$parentAttrId]/ValueList/Value[1]/@id = '-10' or not($CurrentAttributeXPath[@id=$parentAttrId]/ValueList)))">
<!-- (When the selected attribute = -10) or (There is no selected attribute in the sale/item and the first value inside the parent has an id of -10)
Lets give our Netscape viewers the courtesy of not having a squashed dropdown. Go NS 4.7!!!!!
-->
<script LANGUAGE="JavaScript1.1">
var thisChild = "<xsl:value-of select="$FieldName"/>"; //if child does not have dep valuelist, then disable it.
attr_disable(thisChild);
</script>
<xsl:call-template name="EmptyDropdown"/>
</xsl:when>
<xsl:when test="$syiParentValueId and $CurrentAttributeXPath[@id=$parentAttrId]/Dependency[@type='1' or @type='2']">
<xsl:variable name="values" select="$CurrentAttributeXPath[@id=$parentAttrId]/Dependency[ (@parentValueId=$syiParentValueId) and (@childAttrId = $attrId) ]"/>
<xsl:choose>
<xsl:when test="not($values)">
<script LANGUAGE="JavaScript1.1">
var thisChild = "<xsl:value-of select="$FieldName"/>"; //if child does not have dep valuelist, then disable it.
attr_disable(thisChild);
</script>
<xsl:call-template name="EmptyDropdown"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$values" mode="dep">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="FieldName" select="$FieldName"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$CurrentAttributeXPath[@id=$attrId]/ValueList/Value">
<xsl:with-param name="attrId" select="$attrId"/>
<xsl:with-param name="SelectedAttributeXPath" select="$SelectedAttributeXPath"/>
<xsl:with-param name="FieldName" select="$FieldName"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</select>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pfId" select="$CurrentAttributeXPath[@id=$attrId]/InputFields/Input/Value/@pfId"/>
<xsl:variable name="pfPageType" select="$CurrentAttributeXPath[@id=$attrId]/InputFields/Input/Value/@pfPageType"/>
<xsl:variable name="selectedValue" select="$CurrentAttributeXPath[@id=$attrId]/InputFields/Input/Value/@id"/>
<select>
<xsl:if test="$attrData[@id=$attrId]/Dependency[@type='1'] or (/ebay/SYI.Data and $attrData[@id=$attrId]/Dependency[@type='2' or @type='4'])">
<xsl:attribute name="onChange">attr_onchange('<xsl:value-of select="$inputName"/>',this.form.name);</xsl:attribute>
</xsl:if>
<xsl:attribute name="name"><xsl:value-of select="$inputName"/></xsl:attribute>
<xsl:attribute name="class"><xsl:value-of select="$inputName"/></xsl:attribute>
<xsl:choose>
<xsl:when test="$parentAttrId">
<xsl:variable name="parentValueId" select="$returnAttr[@id=$parentAttrId]/InputFields/Input/Value/@id"/>
<xsl:choose>
<xsl:when test="$parentValueId != '-24'">
<xsl:choose>
<xsl:when test="$attrData[@id=$parentAttrId]/Dependency[@parentValueId=$parentValueId and @childAttrId=$attrId]">
<xsl:apply-templates select="$attrData[@id=$parentAttrId]/Dependency[@parentValueId=$parentValueId and @childAttrId=$attrId]/Value" mode="dep"/>
</xsl:when>
<xsl:when test="$subPage='APIPF'">
</xsl:when>
<xsl:otherwise>
<script LANGUAGE="JavaScript1.1">
var thisChild = "a<xsl:value-of select="$attrId"/>"; //if child does not have dep valuelist, then disable it.
attr_disable(thisChild);
</script>
<xsl:call-template name="EmptyDropdown"/>