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

create multiple tables using a single XSL stylesheet?

Subject: create multiple tables using a single XSL stylesheet?
From: "Wielenga, Geertjan" <Geertjan.Wielenga@xxxxxxxxxxxxxxxx>
Date: Mon, 27 Mar 2000 19:15:05 +0200
html multiple tables
Hi...

I want to output two tables. The first for source data which refers to a
room (e.g., a reception room) and the second for data from the same source
which refers to a person (e.g., an employee). Both categories are found
within the same XML source but need to be placed in separate tables. made an
attempt using the XSL below, but this fails... Help!

- Geertjan Wielenga



<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<html>
			<head>
				<title>Amsterdam Office List</title>
			</head>
			<body>
				<font color="red"><h1>Amsterdam Office
List</h1></font>
				<xsl:apply-templates/>
			</body>
		</html>	
	</xsl:template>		
	
	<xsl:template match ="LIST">
	
			<h2>Employee List</h2>
			
			
			<xsl:choose>
				<xsl:when test="LIST/EMPLOYEE/ITEM[1][.='a
room']">
					<table border="1"><font
color="green"></font>			
						<tr>
						<th>Department</th>
						<th>Room title</th>
						<th>Room number</th>
						<th>Phone</th>
						<th>Initials</th>
						</tr>
					</table>
				</xsl:when>
				<xsl:otherwise>
				<table border="1"><font
color="green"></font>
						<tr>
						<th>Department</th>
						<th>Surname</th>
						<th>First name</th>
						<th>Room number</th>
						<th>Phone</th>
						<th>Initials</th>
						</tr>
				</table>	
				</xsl:otherwise>
			</xsl:choose>			
					<xsl:apply-templates
select="EMPLOYEE">
						<xsl:sort select="ITEM[2]"/>
					</xsl:apply-templates>
	</xsl:template>		
		
	<xsl:template match="EMPLOYEE">
		<tr>
			<td><font color="red"><xsl:value-of
select="ITEM[6]"/></font></td>
			<td><font color="red"><xsl:value-of
select="ITEM[1]"/></font></td>
			<td><font color="red"><xsl:value-of
select="ITEM[2]"/></font></td>
			<td><font color="red"><xsl:value-of
select="ITEM[4]"/></font></td>
			<td><font color="red"><xsl:value-of
select="ITEM[3]"/></font></td>
			<td><font color="red"><xsl:value-of
select="ITEM[5]"/></font></td>
		</tr>	
	</xsl:template>

</xsl:stylesheet>


 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.