Groups | Blog | Home
all groups > dotnet xml > july 2006 >

dotnet xml : link to other page from xsl


Wang Xiaoning
7/27/2006 2:37:23 PM
Hi, i have the following xsl file
----------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="FirstLetter"></xsl:param>

<xsl:template match="customerlist">
<html>
<body>
<table border="1" frame="box">
<tr>
<TH>Customer</TH>
<TH>Number</TH>
<TH>Address</TH>
</tr>
<xsl:for-each select="mag_customer[substring(@customer,1,1) =
$FirstLetter]">
<tr>
<td>
<xsl:value-of select="@customer"/>
</td>
<td>
<xsl:value-of select="@customer_number"/>
</td>
<td>
<xsl:value-of select="@address"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>
------------------------------------------------------------------------------------------------------------

what i want from this file is to ref to another page, so if user
clicked "customer" filed, it will go to the selected customer detail
information page. can i do this?
Wang Xiaoning
7/28/2006 11:13:55 AM
thanks, it works perfect.
Martin Honnen
7/28/2006 6:10:48 PM


[quoted text, click to view]


[quoted text, click to view]

Your XSLT stylesheet generates a HTML document, so simply make it
generate a HTML document with a HTML link e.g.
<a href="showDetails.aspx?customer_number={@customer_number}">
<xsl:value-of select="@customer_number"/>
</a>
Of course you need to implement showDetails.aspx then.


--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button