Well I didn't exactly get a flood of suggestions on the forum, but I was able to come up with the exact implementation I was thinking about by creating my own XSLT Extension for ASPDNSF. I found this link very helpful: http://support.webopius.com/viewtopic.php?f=2&t=27 Here is the code for all who are interested.
First, create a class library in Visual Studio. Make sure you build with the correct .NET runtime that matches your version of ASPDNSF or you will get an error. Here is all the code it took to implement parsing of topic references inside a product description:
Code:
using System.Collections.Generic;
using AspDotNetStorefrontCore;
public class RifleGearXSLT : XSLTExtensionBase
{
public RifleGearXSLT()
: this(null, 1, null)
{
}
public RifleGearXSLT(Customer cust, int SkinID)
: base(cust, SkinID)
{
}
public RifleGearXSLT(Customer cust, int SkinID, Dictionary<string, EntityHelper> EntityHelpers)
: base(cust, SkinID)
{
}
public string ParseDescription(string desc)
{
Parser p = new Parser(ThisCustomer.SkinID, ThisCustomer);
return p.ReplaceTokens(desc);
}
}
Copy your .dll assembly into the /bin directory on the website. In my example the filename is RifleGearXSLT.dll
Next you need to define your XSLT extension in your web.config file:
Code:
<!-- Add your own custom XSLTExtensionObjects here -->
<xsltobjects defaultExtension="">
<extensions>
<clear />
<add name="receipt" namespace="urn:receipt" type="ReceiptXsltExtension, app_code"/>
<add name="mobile" namespace="urn:mobile" type="Vortx.MobileFramework.MobileXSLTExtensionBase, app_code"/>
<add name="RifleGear" namespace="urn:RifleGear" type="RifleGearXSLT" />
</extensions>
</xsltobjects>
In your XMLPackage file you need to add your extension in the <PackageTransform><xsl:stylesheet> tag:
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:RifleGear="urn:RifleGear" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf RifleGear">
Finally, modify the code in your package to pass the description parameter through your extension and it will insert topics in place of the tokens:
Code:
<div>
<!--xsl:value-of select="$pDescription" disable-output-escaping="yes"/-->
<xsl:value-of select="RifleGear:ParseDescription($pDescription)" disable-output-escaping="yes"/>
</div>