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

Transpose of Table

Subject: Transpose of Table
From: "Animesh Sharma" <asharma@xxxxxxxxxxxxxxxx>
Date: Wed, 24 Dec 2003 11:47:14 +0530
transpose table
Hi,

I want to write a XSL which will output me the transpose of existing XHTML.

Suppose I have input something like:

<?xml version="1.0"?>
<html>
   <body>
      <p>Test Table</p>
	<table border="1">
		<TR>
			<TD>1 </TD>
			<TD>2 </TD>
			<TD>3 </TD>
		</TR>
		<TR>
			<TD>4 </TD>
			<TD>5 </TD>
			<TD>6 </TD>
		</TR>	
		<TR>
			<TD>7 </TD>
			<TD>8 </TD>
			<TD>9 </TD>
		</TR>	
	</table>  
 </body>
</html>

i.e

Test Table
1 2 3
4 5 6
7 8 9

I want to write an XSl which will give me transpose of above table and output will look like:

Test Table
1 4 7
2 5 8
3 6 9
 
i.e.
<?xml version="1.0"?>
<html>
   <body>
      <p>Test Table</p>
	<table border="1">
		<TR>
			<TD>1 </TD>
			<TD>4 </TD>
			<TD>5 </TD>
		</TR>
		<TR>
			<TD>2 </TD>
			<TD>5 </TD>
			<TD>8 </TD>
		</TR>	
		<TR>
			<TD>3 </TD>
			<TD>6 </TD>
			<TD>9 </TD>
		</TR>	
	</table>  
 </body>
</html>

Well, I want to write a generic XSL which can work for any n*n table.

Thanks and Regards,
Animesh

 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.