[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] How to get the value selected by the User


Subject: [xsl] How to get the value selected by the User
From: "Deepa D" <deepa_das@xxxxxxxxx>
Date: Thu, 07 Mar 2002 23:57:22 +0530

Hi,
   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.
Has anyone got any suggestions?
Thanx,
Deepa

These are my xml & xsl files
XML******************************************************************
<?xml version="1.0"?>
<!DOCTYPE DateList>
<DateList Selected="0">
  <Day Name="Sunday">3/3/2002</Day>
  <Day Name="Monday">3/4/2002</Day>
  <Day Name="Tuesday">3/5/2002</Day>
  <Day Name="Wednesday">3/6/2002</Day>
  <Day Name="Thursday">3/7/2002</Day>
  <Day Name="Friday">3/8/2002</Day>
  <Day Name="saturday">3/9/2002</Day>
</DateList>
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">
	<msxsl:script Language="VB" implements-prefix="DateSelect" language='VB'>
	<![CDATA[		
		Public Function fEnterTimeDetails(byval dt_sel as Date)
			seldate = dt_sel
			msgbox("Hello")
			return seldate
		End Function
	]]>
 </msxsl:script>
	<xsl:variable name="Seldate" />
	<xsl:template match="/">
		<html>
			<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">"DateSelect: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>
*****************************************************************


2,000,000,000 Web Pages--you only need 1. Save time with My Lycos.
http://my.lycos.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords