XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
chandra sekharSubject: FOR loop for Drop Down box in XSL
Author: chandra sekhar
Date: 28 Nov 2006 01:38 AM
hi
here my xml code is like this
<devicelist>
<device>
<title>Diskette Drive A:</title>
<position>1</position>
<position>2</position>
<position>3</position>
<position>4</position>
<position>5</position>
</device>
<device>
<title>IDE CD ROM Device</title>
<position>1</position>
<position>2</position>
<position>3</position>
<position>4</position>
<position>5</position>
</device>
<device>
<title>Hard Drive</title>
<position>1</position>
<position>2</position>
<position>3</position>
<position>4</position>
<position>5</position>
</device>
</devicelist>

like this i have five devices. so i want to display in one row like
device name and corresponding dropdown box. Each dropdown box should contain 1,2,3,4,5 values.

wat should i write in xsl file.

here i have some xsl code
<xsl:for-each select="devicelist/device">
<tr>
<td>
<xsl:value-of select="title" />
</td>

<td>
<select>
<option>
<xsl:attribute name="position"><xsl:value-of select="@position"/></xsl:attribute>
<xsl:value-of select="position"/>
</option>
</select>
</td>
</tr>
</xsl:for-each>

with this code i can display device name and coresponding dropdown box with value 1 only in each box.

please help me

Thanks
chandra

Posttop
James DurningSubject: FOR loop for Drop Down box in XSL
Author: James Durning
Date: 30 Nov 2006 01:15 PM
Originally Posted: 30 Nov 2006 01:16 PM
<select>
<xsl:for-each select="position">
<option>
<xsl:attribute name="position"><xsl:value-of select="."/></xsl:attribute>
<xsl:value-of select="."/>
</option>
</xsl:for-each>
</select>

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.