This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: can we use html objects in xsl
- To: xsl-list at mulberrytech dot com
- Subject: Re: can we use html objects in xsl
- From: Mike Brown <mike at skew dot org>
- Date: Fri, 26 May 2000 16:41:59 -0600 (MDT)
- Reply-To: xsl-list at mulberrytech dot com
> lets say we have a xml like
> <groupinfo >
> <name > users </name>
> <ids> <id> 111</id>
> <id > 222</id>
> <id> 333<i/d >
> </ids>
> </groupinfo>
>
> I want the html ouptut like
>
> <input = text , name = "name" value = "user">
> <select name = id>
> <option value = 111>111
> <option value = 222>222
> <option value = 333>333
> </select>
Use xsl:output method="html" and this template:
<xsl:template match="groupinfo">
<input type="text" name="name" value="{normalize-space(name)}"/>
<select name="id">
<xsl:for-each select="ids/id">
<option value="normalize-space()">
<xsl:value-of select="normalize-space()"/>
</option>
</xsl:for-each>
</select>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list