Thanks Geert
Ill post these in 2 posts as they are on different computers.
Here is the xsl that this function works in.
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xasp="urn:asp-objects">
<xsl:template match="/">
<div id="maincontent">
<!--variable for parsing links - set in glbMain-->
<xsl:variable name="url2sub">
<xsl:value-of select="xasp:GetRequestVariable('url2','session')" />
</xsl:variable>
<!--2nd variable for parsing links - set in glbMain-->
<xsl:variable name="url2sub2">
<xsl:value-of select="xasp:GetRequestVariable('url2sub2','session')" />
</xsl:variable>
<!--variables for back link-->
<xsl:variable name="back1">
<xsl:value-of select="substring(//parent-form/url2,$url2sub,18)" />
</xsl:variable>
<xsl:variable name="back2">
<xsl:value-of select="substring(//form/url2,$url2sub,11)" />
</xsl:variable>
<xsl:variable name="back3">
<xsl:value-of select="//form/@id" />
</xsl:variable>
<xsl:variable name="backmain">
<xsl:value-of select="substring(//parent-form/url2,$url2sub)" />
</xsl:variable>
<xsl:variable name="backcat">
<xsl:value-of select="substring(//top-level-form/url2,$url2sub)" />
</xsl:variable>
<xsl:variable name="cn">
<xsl:value-of select="//top-level-form/name" />
</xsl:variable>
<!-- build the crumbtrail -->
<ul class="crumbtrail">
<li><a href="index.asp">Home</a> ::</li>
<li><a href="index.asp?cat={$backcat}&cn={$cn}"><xsl:value-of select="//top-level-form/name" /></a> ::</li>
<xsl:if test="not(//top-level-form/name=//parent-form/name)">
<li><a href="index.asp?cat={$backmain}"><xsl:value-of select="//parent-form/name" /></a> ::</li>
</xsl:if>
<li><a href="index.asp?cat={$back1}{$back2}{$back3}"><xsl:value-of select="//category/title" /> </a></li>
<xsl:for-each select="//bread-crumbs/crumb">
<xsl:variable name="url-value">
<xsl:value-of select="@url-value" />
</xsl:variable>
<xsl:if test="@type='attribute'">
<li>:: <a href="index.asp?cat={$back1}{$back2}{$back3}/keyword-/dnatrs-{$url-value}"><xsl:value-of select="@display-value" /></a></li>
</xsl:if>
</xsl:for-each>
</ul>
<!-- Main Content -->
<div id="mainresults">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="nopadding" colspan="4">
<h1>Items Found (<xsl:value-of select="//domain/domain-listing/hybrid-items/@total" />)</h1>
</td>
</tr>
<tr>
<td class="nopadding" colspan="4">
<!-- get session variable for link-->
<xsl:variable name="catid">
<xsl:value-of select="substring(//form/url2,$url2sub)" />
</xsl:variable>
<!-- get session variable for sort order-->
<xsl:variable name="so">
<xsl:value-of select="xasp:GetRequestVariable('so','session')" />
</xsl:variable>
<!-- build variable for narrowing down the results -->
<xsl:variable name="narrow">
<xsl:for-each select="//bread-crumbs/crumb">
<xsl:if test="@type='attribute'">
<xsl:value-of select="concat(@url-value,'-')" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<!-- get session variable for page no-->
<xsl:variable name="pg">
<xsl:value-of select="xasp:GetRequestVariable('pg','session')" />
</xsl:variable>
<!-- get session variable for sortby-->
<xsl:variable name="sb">
<xsl:value-of select="xasp:GetRequestVariable('sb','session')" />
</xsl:variable>
<!-- build sort by links -->
<div class="sortbar">
Sort by:
<xsl:choose>
<xsl:when test="$sb=0">
<xsl:choose>
<xsl:when test="$so=2">
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=0&so={$so}">Best match
<img style="vertical-align:top;" border="0" src="sort.gif" /></a>  
</xsl:when>
<xsl:otherwise>
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=0&so={$so}">Best match
<img style="vertical-align:top;" border="0" src="sortdesc.gif" /></a>  
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=0&so={$so}">Best match</a>  
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$sb=2">
<xsl:choose>
<xsl:when test="$so=2">
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=2&so={$so}">Price
<img style="vertical-align:top;" border="0" src="sort.gif" /></a>  
</xsl:when>
<xsl:otherwise>
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=2&so={$so}">Price
<img style="vertical-align:top;" border="0" src="sortdesc.gif" /></a>  
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=2&so={$so}">Price</a>  
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$sb=3">
<xsl:choose>
<xsl:when test="$so=2">
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=3&so={$so}">Store Name
<img style="vertical-align:top;" border="0" src="sort.gif" /></a>  
</xsl:when>
<xsl:otherwise>
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=3&so={$so}">Store Name
<img style="vertical-align:top;" border="0" src="sortdesc.gif" /></a>  
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=3&so={$so}">Store Name</a>  
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$sb=5">
<xsl:choose>
<xsl:when test="$so=2">
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=5&so={$so}">Store Rating
<img style="vertical-align:top;" border="0" src="sort.gif" /></a>  
</xsl:when>
<xsl:otherwise>
<a class="selected" href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=5&so={$so}">Store Rating
<img style="vertical-align:top;" border="0" src="sortdesc.gif" /></a>  
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="index.asp?cat={$catid}/dnatrs-{$narrow}&sb=5&so={$so}">Store Rating</a>  
</xsl:otherwise>
</xsl:choose>
</div>
</td>
</tr>
<!-- display the products -->
<xsl:for-each select="//domain/domain-listing/hybrid-items/store-offer">
<!--path for product image-->
<xsl:variable name="offer-image">
<xsl:value-of select="offer-image" />
</xsl:variable>
<!--path for store logo-->
<xsl:variable name="store-logo">
<xsl:value-of select="store-logo" />
</xsl:variable>
<!-- path for store-rating-image -->
<xsl:variable name="store-rating-image">
<xsl:value-of select="store-rating-image" />
</xsl:variable>
<!--url for deal-->
<xsl:variable name="offer-url">
<xsl:value-of select="offer-url" />
</xsl:variable>
<!-- url encoded offer-url link so that we can pass it through to a redirect.asp page -->
<xsl:variable name="offer-url-encoded">
<xsl:value-of select="xasp:encodeURL(string(offer-url))" />
</xsl:variable>
<tr>
<td>
<img src="{$offer-image}" />
</td>
<td valign="top">
<strong><a href="redirect.asp?target={$offer-url-encoded}" target="_blank"><xsl:value-of select="offer-name" /></a></strong><br/><br/>
<xsl:value-of select="offer-description" /><br/><br/>
<strong>In stock:</strong> <xsl:value-of select="in-stock" /><br/>
<xsl:if test="not(string-length(stock-description)=0)">
<strong>Availability:</strong> <xsl:value-of select="stock-description" /><br/><br/>
</xsl:if>
</td>
<td width="20%" align="center">
<img src="{$store-logo}" /><br/><br/>
<xsl:choose>
<xsl:when test="(string-length($store-rating-image)=0)">
Not Reviewed
</xsl:when>
<xsl:otherwise>
<img src="{$store-rating-image}" /><br/><br/>
</xsl:otherwise>
</xsl:choose>
</td>
<td width="20%" align="center" valign="center">
<br/>£<xsl:value-of select="format-number(offer-price,'###,##0.00')" /><br/>
P&P <xsl:value-of select="shipping" /><br/>
<strong>£
<xsl:choose>
<xsl:when test="string(number(total-price))='NaN'">
<xsl:value-of select="total-price" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(total-price,'###,##0.00')" />
</xsl:otherwise>
</xsl:choose>
</strong><br/>
<a href="redirect.asp?target={$offer-url-encoded}" target="_blank"><img style="margin:8px 0px;" src="buynow2.gif" border="0" /></a><br/>
<a href="redirect.asp?target={$offer-url-encoded}" target="_blank"><xsl:value-of select="store-name" /></a><br/><br/>
</td>
</tr>
</xsl:for-each>
</table>
</div>
<!-- show "narrow results by" column -->
<xsl:choose>
<xsl:when test="//attribute-list/attribute">
<div id="narrowresults">
<h1>Narrow results by</h1>
<xsl:for-each select="//attribute-list/attribute">
<h2><xsl:value-of select="@name" /></h2>
<div class="narrowresultscontent">
<xsl:for-each select="attr-value">
<xsl:variable name="filter">
<xsl:value-of select="substring(url2,$url2sub2)" />
</xsl:variable>
<a href="index.asp?cat={$filter}"><xsl:value-of select="name" /></a> <span class="smallcounter">(<xsl:value-of select="count" />)</span><br/>
</xsl:for-each><br/>
</div>
</xsl:for-each>
</div>
</xsl:when>
<xsl:otherwise>
<div id="narrowresults">
<h1>Narrow results by</h1>
<xsl:variable name="results">
<xsl:value-of select="//domain/domain-listing/hybrid-items/@total" />
</xsl:variable>
<xsl:choose>
<xsl:when test="$results=1">
<div class="narrowresultscontent"><strong>There is <xsl:value-of select="$results" /> item that
matched your selection.</strong> There are no additional ways to narrow down these results.</div>
</xsl:when>
<xsl:otherwise>
<div class="narrowresultscontent"><strong>There are <xsl:value-of select="$results" /> items that
matched your selection.</strong> There are no additional ways to narrow down these results.</div>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
</xsl:stylesheet>
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283:





by: GertonePosted on 2009-07-11 at 12:02:51ID: 24831845
this is either an external function,
so you will need a bunch of other things
including making the extension function library accessible
(eg. if java, make sure the jar is on the classpath)
or this is a XSLT2 function,
make sure that yu include the definition then and that your stylesheet is an XSLT2 stylesheet and you have an XSLT2 processor
lots of things that cann go wrong.
I think it would b esmart if you posted both the XSLT that had this working and the XSLT that has this not working
cheers
Geert