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

Generic Dropdown template

Subject: Generic Dropdown template
From: atulss@xxxxxxxxxx
Date: Mon, 24 Mar 2003 21:27:54 +0530
dropdown template
Hi,

As in my application, there are many dropdowns for which data may come from XML,
(eg. to display date - day, month, year or grade of user etc.)
I would like to create new generic template for displaying dropdown on the screen. 

but this doesn't work. Can anybody help me.
thanks in advance.

	<xsl:template name="GetDropDown">		
		<xsl:param name="xpath"/>		
		<xsl:param name="option"/>		
		<xsl:param name="id"/>		
		<xsl:param name="sel"/>		
		<xsl:for-each select="$xpath">			
			<option>				
				<xsl:attribute name="value">					
					<xsl:value-of select="ID"/>				
				</xsl:attribute>				
				<xsl:if test="($id) = ($sel)">					
					<xsl:attribute name="selected">
							true
					</xsl:attribute>				
				</xsl:if>				
				<xsl:value-of select="$option"></xsl:value-of>			
			</option>		
		</xsl:for-each>	
	</xsl:template>	

My XML look like, where User_info element stores id for the selected option.

<ROOT>
	<USER_INFO>
		<USER_NAME>Kevin Smith</USER_NAME>
		<GRADE>2</GRADE>
	</USER_INFO>
	
	<GRADE>
		<ROW num="1"> <M>Grade 1</M><ID>1</ID> </ROW>
		<ROW num="2"> <M>Grade 2</M><ID>2</ID> </ROW>
		<ROW num="3"> <M>Grade 3</M><ID>3</ID> </ROW>
		<ROW num="4"> <M>Grade 4</M><ID>4</ID> </ROW>
		<ROW num="5"> <M>Grade 5</M><ID>5</ID> </ROW>
	</GRADE>
</ROOT>	

regards,
Atul Samnerkar




MASTEK
Investing in relationships
In the US, we're called MAJESCO

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from all computers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


 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.