This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to get the value selected by the User
- From: "Hunsberger, Peter" <Peter dot Hunsberger at stjude dot org>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 7 Mar 2002 12:42:03 -0600
- Subject: RE: [xsl] How to get the value selected by the User
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I am displaying a dynamically created xml file in an aspx page.
> The xml file contains the dates of the current week.When the User clicks
on one of the dates,I want to
> get that value in the aspx page.
> Currently, I am trying to set an attribute value, at the OnClick of the
date element through an
> msxsl:script function.But it doesn't seem to be going into that function.
I believe you are confusing XML extensions with JavaScript functions? Just
output the script as part of the <head> section, and call it without a name
space as you would in any normal HTML page...
Here's a modified version of your XSL:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:DateSelect="urn:my-scripts">
<xsl:variable name="Seldate" />
<xsl:template match="/">
<html>
<head>
<![CDATA[
Public Function fEnterTimeDetails(byval dt_sel as Date)
seldate = dt_sel
msgbox("Hello")
return seldate
End Function
]]>
</head>
<body BgColor="FFAAAA">
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="DateList">
<table cellpadding="6" cellspacing="1">
<th ColSpan="2">
<font color="purple">Select a Date</font>
</th>
<xsl:for-each select="Day">
<tr>
<td width="100">
<font color="blue">
<xsl:value-of
select="@Name" />
</font>
</td>
<td Align="Right">
<font color="green">
<xsl:attribute
name="style">cursor=hand</xsl:attribute>
<xsl:attribute
name="OnClick">"fEnterTimeDetails('<xsl:value-of select="."
/><xsl:text></xsl:text>')"</xsl:attribute>
<xsl:value-of
select="." />
<xsl:text></xsl:text>
</font>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list