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

table in html with exactly four columns in xsl

Subject: table in html with exactly four columns in xsl
From: "Markus Hanel" <markus.hanel@xxxxxx>
Date: Thu, 25 Sep 2003 20:31:23 +0200 (MEST)
table in html
hallo,
I am a beginner with xml, and my problem is to create a table in html 
with rows and exactly 4 columns to number automatic a few forms. 
The last row should be filled up to 4 columns with empty cells or one cell
with "colspan".
this last row problem i could not solved!
many thanks!
markus

this should be the form!
test1  test2  test3  test4 
test5  test6  test7  test8 
test9  test10 test11 test12 
test13 empty  empty  empty
          cell       cell     cell


<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<?xml-stylesheet href="tabelle.xsl" type="text/xsl"?>
<!DOCTYPE interview SYSTEM "tabelle.dtd">
<interview>
<form>test1</form>
<form>test2</form>
<form>test3</form>
<form>test4</form>
<form>test5</form>
<form>test6</form>
<form>test7</form>
<form>test8</form>
<form>test9</form>
<form>test10</form>
<form>test11</form>
<form>test12</form>
<form>test13</form>
</interview>

with the xsl

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="cols" select="4" />

<xsl:template match="interview">

<html>
<head>
<title>tabelle</title>
</head>
<body>
<table border="1">
  <xsl:apply-templates select="//form[position() mod $cols = 1]" mode="row"
/>
</table>
</body>
</html>
</xsl:template>

<xsl:template match="form" mode="row">
<tr>
  <xsl:apply-templates select=". |following-sibling::form[position() &lt;
$cols]" mode="cell" />
</tr>
</xsl:template>


<xsl:template match="form" mode="cell">
<td>
  <xsl:apply-templates />
</td>
</xsl:template>

</xsl:stylesheet>

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++


 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.