<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- requires $baseURL parameter to be passed in on XmlTransform call -->
<xsl:param name="baseURL" />
<xsl:param name="productAttachmentTypeIDs" />

<xsl:output method="xml" omit-xml-declaration="yes" cdata-section-elements="script"/>
<xsl:template match="a/@href">
	<xsl:attribute name="href">
		<xsl:choose>
			<xsl:when test="starts-with(current(),'fse://attachments/products')">
				<xsl:value-of select="concat( 'javascript:Fse.SIM.showAttachments(&quot;', $baseURL, '&quot;,&quot;products&quot;,&quot;', $productAttachmentTypeIDs, '&quot;)')"/>
			</xsl:when>
			<xsl:when test="starts-with(current(),'fse:')">
				<xsl:value-of select="concat( 'javascript:Fse.SIM.showProduct(&quot;', $baseURL, '&quot;, &quot;', substring-after( current(), 'product/' ), '&quot;)')"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="."/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:attribute>
</xsl:template>
<xsl:template match="node()|@*">
	<xsl:copy>
		<xsl:apply-templates select="node()|@*"/>
	</xsl:copy>
</xsl:template>
</xsl:transform>