[xsl] XSL and HTML select

Subject: [xsl] XSL and HTML select
From: "Samuli Niiranen" <samuli.niiranen@xxxxxx>
Date: Tue, 20 Mar 2001 12:24:36 +0200
Here's my problem:

I have a XML file which consists of measurement records:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="results.xsl"?>
<hctv_data>
	<measurement id="4">
		<date>07.03.2001</date>
		<time>12:45</time>
		<inr>3.4</inr>
	</measurement>
</hctv_data>

I wish to use a XSL file to transform these records to HTML and to use HTML
select to view only the records with the selected id:

<FORM NAME="idForm">
	<SELECT NAME="selectId" SIZE="1">
		<xsl:for-each select="/*/measurement/@id">
			<OPTION>
				<xsl:attribute name="VALUE">
					<xsl:value-of select="."/>
				</xsl:attribute>
			<xsl:value-of select="."/>
			</OPTION>
		</xsl:for-each>
	</SELECT>
</FORM>

<xsl:for-each select="measurement[@id=$SelectedId]">
	<tr>
		<td><xsl:value-of select="@id"/></td>
		<td><xsl:value-of select="date"/></td>
		<td><xsl:value-of select="time"/></td>
		<td><xsl:value-of select="inr"/></td>
	</tr>
</xsl:for-each>

How can I relay the selected menu option to the XSL variable SelectedId ?


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


Current Thread