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

click header column to sort data.

Subject: click header column to sort data.
From: Tham Tinh <khautinh@xxxxxxxxx>
Date: Fri, 30 May 2003 14:49:36 -0700 (PDT)
xsl column sort
Just in case my first message was not delivery
I have one xml and one xslt file as attachments. 
Please take a look and help me when I click on the
header column and make that column sort.

Thanks

XML file
--------

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="D:\My 
Documents\Download\Adminlist.xslt"?>
<Adminlist>
	<sponsoroffice>
		<OfficeName>Somewhere            </OfficeName>
		<administratorname>
			<Lname>Bui</Lname>
			<Fname>Binh</Fname>
			<Phone>1234567890</Phone>
			<Email>test@xxxxxxxxxxxxx</Email>
		</administratorname>
	</sponsoroffice>
	<sponsoroffice>
		<OfficeName>Seattle            </OfficeName>
		<administratorname>
			<Lname>someone</Lname>
			<Fname>Nobody</Fname>
			<Phone>0987654321</Phone>
			<Email>mickey@xxxxxxx</Email>
		</administratorname>
	</sponsoroffice>
	<sponsoroffice>
		<OfficeName>Portland              </OfficeName>
		<administratorname>
			<Lname>Smith</Lname>
			<Fname>Blue</Fname>
			<Phone>3541873658</Phone>
			<Email>mouse@xxxxxxx</Email>
		</administratorname>
		<administratorname>
			<Lname>Cat</Lname>
			<Fname>Eighty</Fname>
			<Phone>3541867894</Phone>
			<Email>cat@xxxxxxx</Email>
		</administratorname>
	</sponsoroffice>
</Adminlist>


XSL File
--------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xsl:template match="/">
		<html>
			<head/>
			<center><h1>Administrator List</h1></center>
			<center><hr/></center>
			<body>
				<xsl:for-each select="Adminlist">
					<br/>
					<xsl:for-each select="sponsoroffice">
						<xsl:if test="position()=1">
							<table width="100%" border="0">
								<thead style="cursor:hand;
background-color:wheat">
									<tr>
										<td width="205" align="center">
											<h4><span style="font-size:20">Office
Name</span></h4>
										</td>
										<td width="206" align="center">
											<h4><span style="font-size:20">Last
name</span></h4>
										</td>
										<td width="184" align="center">
											<h4><span style="font-size:20">First
Name</span></h4>
										</td>
										<td width="184" align="center">
											<h4><span
style="font-size:20">Phone</span></h4>
										</td>
										<td width="184" align="center">
											<h4><span
style="font-size:20">Email</span></h4>
										</td>
									</tr>
								</thead>
								<tbody>
									<xsl:for-each select="../sponsoroffice">
										<tr valign="top"
										
onmouseover="this.style.backgroundColor='lightyellow'"

										
onmouseout="this.style.backgroundColor='white'" >
											<td width="205" align="center">
												<xsl:for-each select="OfficeName">
													<br/>
													<xsl:apply-templates/>
													<br/>
												</xsl:for-each>
											</td>
											<td width="206" align="center">
												<xsl:for-each select="administratorname">
													<br/>
													<xsl:for-each select="Lname">
														<xsl:apply-templates/>
													</xsl:for-each>
													<br/>
												</xsl:for-each>
											</td>
											<td width="184" align="center">
												<xsl:for-each select="administratorname">
													<br/>
													<xsl:for-each select="Fname">
														<xsl:apply-templates/>
													</xsl:for-each>
													<br/>
												</xsl:for-each>
											</td>
											<td width="184" align="center">
												<xsl:for-each select="administratorname">
													<br/>
													<xsl:for-each select="Phone">
														<xsl:apply-templates/>
														<br/>
													</xsl:for-each>
												</xsl:for-each>
											</td>
											<td width="184" align="center">
												<xsl:for-each select="administratorname">
													<br/>
													<xsl:for-each select="Email">
														<a text-decoration="underline"
color="blue">
															<xsl:attribute
name="href">mailto:<xsl:value-of 
select="." /></xsl:attribute>
															<xsl:apply-templates/>
														</a>
														<br/>
													</xsl:for-each>
												</xsl:for-each>
											</td>
										</tr>
									</xsl:for-each>
								</tbody>
							</table>
						</xsl:if>
					</xsl:for-each>
					<br/>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>




=====
"It is essential to know that to be a happy person, a happy family, a happy society, it is very crucial to have a good heart, that is very crucial,"
Dalai Lama

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

 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.