datzent83
asked on
XSL break table after a certain number or columns
Hello Experts,
I am sure there is an easy way of doing this but I need to be able to break a table into a new raw after a certain number of columns.
Here is my code:
<td align="center" valign="middle">
<a href="{aspdnsf:ProductLink (ProductID , SEName, $EntityID, $EntityName)}">
<xsl:value-of select="aspdnsf:LookupImag e(ProductI D, 'product', 'icon', 1)" disable-output-escaping="y es"/>
</a>
<br/>
<a href="{aspdnsf:ProductLink (ProductID , SEName, $EntityID, $EntityName)}">
<xsl:value-of select="$vName" disable-output-escaping="y es"/>
</a>
</td>
Basically what I want to do is every time the column reaches a certain number (lets say 3) then the table breaks into a new raw and continues displaying the content on a new raw.
I know there is a way to do it with the XSL position() function but I can't seem to figure out how to implement that into my code.
Thank you all in advance.
I am sure there is an easy way of doing this but I need to be able to break a table into a new raw after a certain number of columns.
Here is my code:
<td align="center" valign="middle">
<a href="{aspdnsf:ProductLink
<xsl:value-of select="aspdnsf:LookupImag
</a>
<br/>
<a href="{aspdnsf:ProductLink
<xsl:value-of select="$vName" disable-output-escaping="y
</a>
</td>
Basically what I want to do is every time the column reaches a certain number (lets say 3) then the table breaks into a new raw and continues displaying the content on a new raw.
I know there is a way to do it with the XSL position() function but I can't seem to figure out how to implement that into my code.
Thank you all in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
datzent83,
> <xsl:apply-templates select="/root/Products/Pro duct"></xs l:apply-te mplates>
put the <xsl:for-each select="//Product[position () mod 3 = 1]">
loop where currently the apply-templates is
put the <xsl:template name="processCell">
somewhere in your stylesheet and it should work
cheers
Geert
> <xsl:apply-templates select="/root/Products/Pro
put the <xsl:for-each select="//Product[position
loop where currently the apply-templates is
put the <xsl:template name="processCell">
somewhere in your stylesheet and it should work
cheers
Geert
ASKER
Hello Geert,
I have applied the code the way you instructed, but I am getting an error which I have never seen before.
This is the error that I am getting:
Exception=Last Trace Point=[]. An error occurred during a call to extension function 'ProductLink'. See InnerException for a complete description of the error.
Below is the code with your instructions. Please take a look at it and let me know what the problem is:
<?xml version="1.0" encoding="utf-8" ?>
<package displayname="Best Sellers" version="2.1" debug="false" allowengine="true">
<query name="Products" rowElementName="Product">
<sql>
<![CDATA[
exec aspdnsf_BestSellers 180, @return, @orderby
exec aspdnsf_GetProducts
@categoryID = @CatID,
@sectionID = @SecID,
@manufacturerID = @ManID,
@distributorID = @DistID,
@localeName = @locale,
@CustomerLevelID = @CustLevelID,
@affiliateID = @AffID,
@ProductTypeID = @ProdTypeID,
@ViewType = 1,
@pagenum = @pgnum,
@pagesize = 24,
@StatsFirst = 0,
@publishedonly = 1,
@ExcludePacks = 0,
@ExcludeKits = 0,
@ExcludeSysProds = 0,
@InventoryFilter = @InvFilter,
@sortEntityName = @entityname
]]>
</sql>
<queryparam paramname="@return" paramtype="appconfig" requestparamname="BestSell ersN" sqlDataType="int" defvalue="10" validationpattern="^\d{1,1 0}$" />
<queryparam paramname="@orderby" paramtype="request" requestparamname="orderby" sqlDataType="int" defvalue="1" validationpattern="^\d$" />
<queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@SecID" paramtype="runtime" requestparamname="SecID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@ManID" paramtype="runtime" requestparamname="ManID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@DistID" paramtype="runtime" requestparamname="DistID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@locale" paramtype="runtime" requestparamname="LocaleSe tting" sqlDataType="varchar" defvalue="en-US" validationpattern="" />
<queryparam paramname="@CustLevelID" paramtype="runtime" requestparamname="Customer LevelID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@AffID" paramtype="runtime" requestparamname="Affiliat eID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@ProdTypeID" paramtype="runtime" requestparamname="ProductT ypeFilterI D" sqlDataType="int" defvalue="1" validationpattern="" />
<queryparam paramname="@pgnum" paramtype="request" requestparamname="pagenum" sqlDataType="int" defvalue="1" validationpattern="" />
<queryparam paramname="@InvFilter" paramtype="appconfig" requestparamname="HideProd uctsWithLe ssThanThis InventoryL evel" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@entityname" paramtype="runtime" requestparamname="EntityNa me" sqlDataType="varchar" defvalue="" validationpattern="" />
</query>
<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf " exclude-result-prefixes="a spdnsf">
<xsl:output method="html" omit-xml-declaration="yes" />
<xsl:param name="ShowSubcatsInGrid">< xsl:value- of select="aspdnsf:AppConfig( 'ShowSubca tsInGrid') " /></xsl:param>
<xsl:param name="SubcatGridCols"><xsl :value-of select="/root/EntityHelper s/*[name() =/root/Run time/Entit yName]/des cendant::E ntity[Enti tyID=/root /Runtime/E ntityID]/C olWidth" /></xsl:param>
<xsl:param name="EntityName"><xsl:val ue-of select="/root/Runtime/Enti tyName" /></xsl:param>
<xsl:param name="EntityID"><xsl:value -of select="/root/Runtime/Enti tyID" /></xsl:param>
<xsl:param name="WholesaleOnlySite">< xsl:value- of select="aspdnsf:AppConfigB ool('Whole saleOnlySi te')"/></x sl:param>
<xsl:param name="LocaleSetting" select="/root/Runtime/Loca leSetting" />
<xsl:param name="WebConfigLocaleSetti ng" select="/root/Runtime/WebC onfigLocal eSetting" />
<xsl:param name="BestSellersShowSales "><xsl:val ue-of select="aspdnsf:AppConfigB ool('BestS ellersShow Sales')" disable-output-escaping="y es" /></xsl:param>
<xsl:param name="ShowPics"><xsl:value -of select="aspdnsf:AppConfigB ool('BestS ellersShow Pics')"/>< /xsl:param >
<xsl:param name="colspan"><xsl:choose ><xsl:when test="BestSellersShowSales ='true'">5 </xsl:when ><xsl:othe rwise>4</x sl:otherwi se></xsl:c hoose></xs l:param>
<xsl:param name="ProductCount" select="count(/root/Produc ts/Product )" />
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$ProductCount > 0">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<xsl:attribute name="style">border-style: solid; border-width: 0px; border-color: #<xsl:value-of select="aspdnsf:AppConfig( 'HeaderBGC olor')" /></xsl:attribute>
<tr>
<td align="left" valign="top">
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<xsl:attribute name="style"><xsl:value-of select="aspdnsf:AppConfig( 'BoxFrameS tyle')" /></xsl:attribute>
<tr>
<td align="left" valign="top">
<table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr>
<xsl:if test="BestSellersShowSales ='true'">
<td align="center"><b><a href="bestsellers.aspx?ord erby=units "><xsl:val ue-of select="aspdnsf:GetString( 'bestselle rs.aspx.1' )" disable-output-escaping="y es" /></a></b></td>
<td align="center"><b><a href="bestsellers.aspx?ord erby=amoun t"><xsl:va lue-of select="aspdnsf:GetString( 'bestselle rs.aspx.2' )" disable-output-escaping="y es" /></a></b></td>
</xsl:if>
</tr>
<tr><td colspan="{$colspan}" height="4" width="100%"><img src="images/spacer.gif" height="1" width="1" /></td></tr>
<xsl:apply-templates select="/root/Products/Pro duct"></xs l:apply-te mplates>
<xsl:for-each select="//Product[position () mod 3 = 1]">
<tr>
<xsl:call-template name="processCell">
<xsl:with-param name="thisProductID" select="ProductID"/>
<xsl:with-param name="thisSEName" select="SEName"/>
</xsl:call-template>
<xsl:call-template name="processCell">
<xsl:with-param name="thisProductID" select="following-sibling: :Product[1 ]/ProductI D"/>
<xsl:with-param name="thisSEName" select="following-sibling: :Product[1 ]/SEName"/ >
</xsl:call-template>
<xsl:call-template name="processCell">
<xsl:with-param name="thisProductID" select="following-sibling: :Product[2 ]/ProductI D"/>
<xsl:with-param name="thisSEName" select="following-sibling: :Product[2 ]/SEName"/ >
</xsl:call-template>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
<tr><td colspan="{$colspan}"> 0;</td></t r>
</table>
</td>
</tr>
</table>
</xsl:when>
<xsl:otherwise>
<p align="left"><b><xsl:value -of select="aspdnsf:GetString( 'bestselle rs.aspx.3' )" disable-output-escaping="y es" /></b></p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="processCell">
<xsl:param name="pName">
<xsl:choose>
<xsl:when test="count(ProductName/ml /locale[@n ame=$Local eSetting]) !=0">
<xsl:value-of select="ProductName/ml/loc ale[@name= $LocaleSet ting]"/>
</xsl:when>
<xsl:when test="count(ProductName/ml /locale[@n ame=$WebCo nfigLocale Setting]) !=0 ">
<xsl:value-of select="ProductName/ml/loc ale[@name= $WebConfig LocaleSett ing]"/>
</xsl:when>
<xsl:when test="count(ProductName/ml )=0">
<xsl:value-of select="ProductName"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="vName">
<xsl:choose>
<xsl:when test="count(VariantName/ml /locale[@n ame=$Local eSetting]) !=0">
<xsl:value-of select="VariantName/ml/loc ale[@name= $LocaleSet ting]"/>
</xsl:when>
<xsl:when test="count(VariantName/ml /locale[@n ame=$WebCo nfigLocale Setting]) !=0 ">
<xsl:value-of select="VariantName/ml/loc ale[@name= $WebConfig LocaleSett ing]"/>
</xsl:when>
<xsl:when test="count(VariantName/ml )=0">
<xsl:value-of select="VariantName"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="ProductName"><xsl:va lue-of select="$pName" /><xsl:if test="$vName!=''"><xsl:val ue-of select="concat('-', $vName)" /></xsl:if></xsl:param>
<xsl:param name="ProductSKU"><xsl:val ue-of select="SKU" /><xsl:if test="SKUSuffix!=''"><xsl: value-of select="SKUSuffix" /></xsl:if></xsl:param>
<xsl:param name="thisProductID"/>
<xsl:param name="thisSEName"/>
<td align="center" valign="middle">
<a href="{aspdnsf:ProductLink ($thisProd uctID, $thisSEName, $EntityID, $EntityName)}">
<xsl:value-of select="aspdnsf:LookupImag e($thisPro ductID, 'product', 'icon', 1)" disable-output-escaping="y es"/>
</a>
<br/>
<a href="{aspdnsf:ProductLink ($thisProd uctID, $thisSEName, $EntityID, $EntityName)}">
<xsl:value-of select="$vName" disable-output-escaping="y es"/>
</a>
</td>
</xsl:template>
</xsl:stylesheet>
</PackageTransform>
</package>
Please help me figure out why that is happening! Thank you!
I have applied the code the way you instructed, but I am getting an error which I have never seen before.
This is the error that I am getting:
Exception=Last Trace Point=[]. An error occurred during a call to extension function 'ProductLink'. See InnerException for a complete description of the error.
Below is the code with your instructions. Please take a look at it and let me know what the problem is:
<?xml version="1.0" encoding="utf-8" ?>
<package displayname="Best Sellers" version="2.1" debug="false" allowengine="true">
<query name="Products" rowElementName="Product">
<sql>
<![CDATA[
exec aspdnsf_BestSellers 180, @return, @orderby
exec aspdnsf_GetProducts
@categoryID = @CatID,
@sectionID = @SecID,
@manufacturerID = @ManID,
@distributorID = @DistID,
@localeName = @locale,
@CustomerLevelID = @CustLevelID,
@affiliateID = @AffID,
@ProductTypeID = @ProdTypeID,
@ViewType = 1,
@pagenum = @pgnum,
@pagesize = 24,
@StatsFirst = 0,
@publishedonly = 1,
@ExcludePacks = 0,
@ExcludeKits = 0,
@ExcludeSysProds = 0,
@InventoryFilter = @InvFilter,
@sortEntityName = @entityname
]]>
</sql>
<queryparam paramname="@return" paramtype="appconfig" requestparamname="BestSell
<queryparam paramname="@orderby" paramtype="request" requestparamname="orderby"
<queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@SecID" paramtype="runtime" requestparamname="SecID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@ManID" paramtype="runtime" requestparamname="ManID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@DistID" paramtype="runtime" requestparamname="DistID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@locale" paramtype="runtime" requestparamname="LocaleSe
<queryparam paramname="@CustLevelID" paramtype="runtime" requestparamname="Customer
<queryparam paramname="@AffID" paramtype="runtime" requestparamname="Affiliat
<queryparam paramname="@ProdTypeID" paramtype="runtime" requestparamname="ProductT
<queryparam paramname="@pgnum" paramtype="request" requestparamname="pagenum"
<queryparam paramname="@InvFilter" paramtype="appconfig" requestparamname="HideProd
<queryparam paramname="@entityname" paramtype="runtime" requestparamname="EntityNa
</query>
<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf
<xsl:output method="html" omit-xml-declaration="yes"
<xsl:param name="ShowSubcatsInGrid"><
<xsl:param name="SubcatGridCols"><xsl
<xsl:param name="EntityName"><xsl:val
<xsl:param name="EntityID"><xsl:value
<xsl:param name="WholesaleOnlySite"><
<xsl:param name="LocaleSetting" select="/root/Runtime/Loca
<xsl:param name="WebConfigLocaleSetti
<xsl:param name="BestSellersShowSales
<xsl:param name="ShowPics"><xsl:value
<xsl:param name="colspan"><xsl:choose
<xsl:param name="ProductCount" select="count(/root/Produc
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$ProductCount > 0">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<xsl:attribute name="style">border-style:
<tr>
<td align="left" valign="top">
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<xsl:attribute name="style"><xsl:value-of
<tr>
<td align="left" valign="top">
<table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr>
<xsl:if test="BestSellersShowSales
<td align="center"><b><a href="bestsellers.aspx?ord
<td align="center"><b><a href="bestsellers.aspx?ord
</xsl:if>
</tr>
<tr><td colspan="{$colspan}" height="4" width="100%"><img src="images/spacer.gif" height="1" width="1" /></td></tr>
<xsl:apply-templates select="/root/Products/Pro
<xsl:for-each select="//Product[position
<tr>
<xsl:call-template name="processCell">
<xsl:with-param name="thisProductID" select="ProductID"/>
<xsl:with-param name="thisSEName" select="SEName"/>
</xsl:call-template>
<xsl:call-template name="processCell">
<xsl:with-param name="thisProductID" select="following-sibling:
<xsl:with-param name="thisSEName" select="following-sibling:
</xsl:call-template>
<xsl:call-template name="processCell">
<xsl:with-param name="thisProductID" select="following-sibling:
<xsl:with-param name="thisSEName" select="following-sibling:
</xsl:call-template>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
<tr><td colspan="{$colspan}">
</table>
</td>
</tr>
</table>
</xsl:when>
<xsl:otherwise>
<p align="left"><b><xsl:value
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="processCell">
<xsl:param name="pName">
<xsl:choose>
<xsl:when test="count(ProductName/ml
<xsl:value-of select="ProductName/ml/loc
</xsl:when>
<xsl:when test="count(ProductName/ml
<xsl:value-of select="ProductName/ml/loc
</xsl:when>
<xsl:when test="count(ProductName/ml
<xsl:value-of select="ProductName"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="vName">
<xsl:choose>
<xsl:when test="count(VariantName/ml
<xsl:value-of select="VariantName/ml/loc
</xsl:when>
<xsl:when test="count(VariantName/ml
<xsl:value-of select="VariantName/ml/loc
</xsl:when>
<xsl:when test="count(VariantName/ml
<xsl:value-of select="VariantName"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="ProductName"><xsl:va
<xsl:param name="ProductSKU"><xsl:val
<xsl:param name="thisProductID"/>
<xsl:param name="thisSEName"/>
<td align="center" valign="middle">
<a href="{aspdnsf:ProductLink
<xsl:value-of select="aspdnsf:LookupImag
</a>
<br/>
<a href="{aspdnsf:ProductLink
<xsl:value-of select="$vName" disable-output-escaping="y
</a>
</td>
</xsl:template>
</xsl:stylesheet>
</PackageTransform>
</package>
Please help me figure out why that is happening! Thank you!
I don't see a definition for this external function
aspdnsf:ProductLink
There is no definition for the other external functions either,
Productlink just happended to be the first one around
you need to implement the functions
something like
<msxsl:script language="JScript" implements-prefix="aspdnsf ">
<![CDATA[
function ProductLink()
{
....
}
]]>
</msxsl:script>
or something similar if you are not using msxml
aspdnsf:ProductLink
There is no definition for the other external functions either,
Productlink just happended to be the first one around
you need to implement the functions
something like
<msxsl:script language="JScript" implements-prefix="aspdnsf
<![CDATA[
function ProductLink()
{
....
}
]]>
</msxsl:script>
or something similar if you are not using msxml
ASKER
Hello Geert,
With your help I have figured out how I can implement the loop into my code. Please take a look at what I have done at the code below. It is not exactly what you have suggested, but it worked. I will however accept your answer as correct! :-)
<xsl:template match="Product">
<xsl:if test="position() mod 4 = 1">
<tr>
<xsl:for-each select=". | following-sibling::*[posit ion() < 4]">
<xsl:call-template name="ProductCell"></xsl:c all-templa te>
</xsl:for-each>
</tr>
</xsl:if>
</xsl:template>
Thank you for your help!!!
With your help I have figured out how I can implement the loop into my code. Please take a look at what I have done at the code below. It is not exactly what you have suggested, but it worked. I will however accept your answer as correct! :-)
<xsl:template match="Product">
<xsl:if test="position() mod 4 = 1">
<tr>
<xsl:for-each select=". | following-sibling::*[posit
<xsl:call-template name="ProductCell"></xsl:c
</xsl:for-each>
</tr>
</xsl:if>
</xsl:template>
Thank you for your help!!!
wellcome,
what you have done is a smart way of avoiding to copy/paste all the template calls, looks nice
cheers
Geert
what you have done is a smart way of avoiding to copy/paste all the template calls, looks nice
cheers
Geert
ASKER
I am having some difficulties implementing your code into my XML Package. I pasted my whole code below, can you please make the appropriate changes in that code?
<?xml version="1.0" encoding="utf-8" ?>
<package displayname="Best Sellers" version="2.1" debug="false" allowengine="true">
<!-- ##########################
<!-- Copyright AspDotNetStorefront.com, 1995-2006. All Rights Reserved. -->
<!-- http://www.aspdotnetstorefront.com -->
<!-- For details on this license please visit the product homepage at the URL above. -->
<!-- THE ABOVE NOTICE MUST REMAIN INTACT. -->
<!-- $Header: /v6.1/Web/XmlPackages/prod
<!-- -->
<!-- ##########################
<query name="Products" rowElementName="Product">
<sql>
<![CDATA[
exec aspdnsf_BestSellers 180, @return, @orderby
exec aspdnsf_GetProducts
@categoryID = @CatID,
@sectionID = @SecID,
@manufacturerID = @ManID,
@distributorID = @DistID,
@localeName = @locale,
@CustomerLevelID = @CustLevelID,
@affiliateID = @AffID,
@ProductTypeID = @ProdTypeID,
@ViewType = 1,
@pagenum = @pgnum,
@pagesize = 24,
@StatsFirst = 0,
@publishedonly = 1,
@ExcludePacks = 0,
@ExcludeKits = 0,
@ExcludeSysProds = 0,
@InventoryFilter = @InvFilter,
@sortEntityName = @entityname
]]>
</sql>
<queryparam paramname="@return" paramtype="appconfig" requestparamname="BestSell
<queryparam paramname="@orderby" paramtype="request" requestparamname="orderby"
<queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@SecID" paramtype="runtime" requestparamname="SecID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@ManID" paramtype="runtime" requestparamname="ManID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@DistID" paramtype="runtime" requestparamname="DistID" sqlDataType="int" defvalue="0" validationpattern="" />
<queryparam paramname="@locale" paramtype="runtime" requestparamname="LocaleSe
<queryparam paramname="@CustLevelID" paramtype="runtime" requestparamname="Customer
<queryparam paramname="@AffID" paramtype="runtime" requestparamname="Affiliat
<queryparam paramname="@ProdTypeID" paramtype="runtime" requestparamname="ProductT
<queryparam paramname="@pgnum" paramtype="request" requestparamname="pagenum"
<queryparam paramname="@InvFilter" paramtype="appconfig" requestparamname="HideProd
<queryparam paramname="@entityname" paramtype="runtime" requestparamname="EntityNa
</query>
<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf
<xsl:output method="html" omit-xml-declaration="yes"
<xsl:param name="ShowSubcatsInGrid"><
<xsl:param name="SubcatGridCols"><xsl
<xsl:param name="EntityName"><xsl:val
<xsl:param name="EntityID"><xsl:value
<xsl:param name="WholesaleOnlySite"><
<xsl:param name="LocaleSetting" select="/root/Runtime/Loca
<xsl:param name="WebConfigLocaleSetti
<xsl:param name="BestSellersShowSales
<xsl:param name="ShowPics"><xsl:value
<xsl:param name="colspan"><xsl:choose
<xsl:param name="ProductCount" select="count(/root/Produc
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$ProductCount > 0">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<xsl:attribute name="style">border-style:
<tr>
<td align="left" valign="top">
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<xsl:attribute name="style"><xsl:value-of
<tr>
<td align="left" valign="top">
<table border="0" cellpadding="0" cellspacing="1" width="100%">
<tr>
<xsl:if test="BestSellersShowSales
<td align="center"><b><a href="bestsellers.aspx?ord
<td align="center"><b><a href="bestsellers.aspx?ord
</xsl:if>
</tr>
<tr><td colspan="{$colspan}" height="4" width="100%"><img src="images/spacer.gif" height="1" width="1" /></td></tr>
<xsl:apply-templates select="/root/Products/Pro
</table>
</td>
</tr>
<tr><td colspan="{$colspan}">
</table>
</td>
</tr>
</table>
</xsl:when>
<xsl:otherwise>
<p align="left"><b><xsl:value
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Product">
<xsl:param name="pName">
<xsl:choose>
<xsl:when test="count(ProductName/ml
<xsl:value-of select="ProductName/ml/loc
</xsl:when>
<xsl:when test="count(ProductName/ml
<xsl:value-of select="ProductName/ml/loc
</xsl:when>
<xsl:when test="count(ProductName/ml
<xsl:value-of select="ProductName"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="vName">
<xsl:choose>
<xsl:when test="count(VariantName/ml
<xsl:value-of select="VariantName/ml/loc
</xsl:when>
<xsl:when test="count(VariantName/ml
<xsl:value-of select="VariantName/ml/loc
</xsl:when>
<xsl:when test="count(VariantName/ml
<xsl:value-of select="VariantName"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="ProductName"><xsl:va
<xsl:param name="ProductSKU"><xsl:val
<td align="center" valign="middle">
<a href="{aspdnsf:ProductLink
<xsl:value-of select="aspdnsf:LookupImag
</a>
<br/>
<a href="{aspdnsf:ProductLink
<xsl:value-of select="$vName" disable-output-escaping="y
</a>
</td>
</xsl:template>
</xsl:stylesheet>
</PackageTransform>
</package>
Thank you in advance!