xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] How to populate a HTML
Subject: RE: [xsl] How to populate a HTML <select> tag..??
From: "Paul Brown" <prb@xxxxxxxxxxxxx>
Date: Sun, 21 Jan 2001 16:02:12 -0600

> [Kevin Duffey]
> Subject: [xsl] 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
Keywords

XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor