[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to populate a HTML <select> tag..??

Subject: RE: How to populate a HTML <select> tag..??
From: "Paul Brown" <prb@xxxxxxxxxxxxx>
Date: Sun, 21 Jan 2001 16:02:12 -0600
html select syntax
> [Kevin Duffey]
> Subject:  How to populate a HTML <select>
> tag..??
> <select name="<xsl:value-of select='.'/>"
> size="1"><option value="<xsl:value-of
> select='.'/>"></select>

It's easy to forget that XSLT is XML (and not a scripted substition language
like Active Server Pages), and any XSLT script needs to obey the rules of
well-formed XML.

You can either use the {} syntax for evaluating expressions in attributes:

	<select name="{.}" size="1">

Or you can use the xsl:attribute element:

	<OPTION>
		<xsl:attribute name="value">
			<xsl:value-of select="." />
		</xsl:attribute>
		Option text goes here.
	</OPTION>

If you really do want a "<" in an attribute (or as part of an expression),
then it needs to be escaped (&lt;).

	- Paul


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.