Hi,Does anyone of you know how to generate a html link on the web if I use XSLT to transform the XML from view? To make it complicated, instead of icon, I want to display the view column value and this value is a link that will open the attachment of the document. I have tried to use html on my view columns formula (with and without). They all turn out to be plain text.
I downloaded the below excellent codes, spent 2 days modifying it, can’t figure out. Your help is appreciated.
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl=“XSLT Namespace”
version="1.0"
xmlns:xalan="http://xml.apache.org/xslt">
<xsl:template match="viewentry[@children]">
<div>
<xsl:attribute name="ID">
<xsl:value-of select="@position" />
</xsl:attribute>
<span style="font-weight:bold;color:red;cursor:hand" onclick="toggleSection(this)">+ </span>
<span style="cursor:hand;color:#000080" onclick="toggleSection(this.previousSibling)">
<xsl:attribute name="NextEntrySrc"><Computed Value>?ReadViewEntries&Start=<xsl:value-of select="@position" />.1&Count=<xsl:value-of select="@children" />&Collapse=<xsl:value-of select="@position" />.1</xsl:attribute>
<xsl:value-of select="entrydata" />
</span>
<div style="margin-left:15px;display:none"></div>
</div>
</xsl:template>
<xsl:template match="viewentry">
<table border="0" width="95%">
<tr bgcolor="#e6e6fa">
<xsl:if test="position() mod 2 != 0">
<xsl:attribute name="bgcolor">beige</xsl:attribute>
</xsl:if>
<td width="1%" valign="bottom"><a target="frmDocPreview" style="text-decoration:none">
<xsl:attribute name="href"><Computed Value><xsl:value-of select="@unid"/><Computed Value>?openelement</xsl:attribute>
<img border="0" src="/icons/doclink.gif" /></a></td>
<xsl:apply-templates select="entrydata" />
</tr>
</table>
</xsl:template>
<xsl:template match="entrydata[@columnnumber=3]">
<td width="39%">
<xsl:value-of select="text" />
</td>
</xsl:template>
<xsl:template match="entrydata[@columnnumber=4]">
<td width="20%">
<xsl:value-of select="text" />
</td>
</xsl:template>
<xsl:template match="entrydata[@columnnumber=5]">
<td width="10%">
<xsl:value-of select="text" />
</td>
</xsl:template>
<xsl:template match="entrydata[@columnnumber=6]">
<td width="10%">
<xsl:value-of select="text" />
</td>
</xsl:template>
<xsl:template match="entrydata[@columnnumber=7]">
<td width="20%">
<xsl:value-of select="number" />
</td>
</xsl:template>
</xsl:stylesheet>