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

Re: Complicated Table

Subject: Re: Complicated Table
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 2 Oct 2002 01:27:40 +0100
html table examples
Hi Millie,

> It's not even slightly clear to me where to start. How do the
> attributes like "numcols" and "numrows" figure in, not to mention
> how do you connect the variable "num" from column_info to the num
> from the rows?

I'd just ignore the numcols and numrows attributes. You don't need
them to turn this XML into an table in HTML or XSL-FO. Just think of
the mapping between the elements in your XML and the HTML or XSL-FO
you want to create. For example for HTML:

         table  =>  table
   column_info  =>  th
           row  =>  tr
        column  =>  td

Then for each of those mappings create a template:

<xsl:template match="table">
  <table>
    <caption><xsl:value-of select="@name" /></caption>
    <tr>
      <xsl:apply-templates select="column_info" />
    </tr>
    <xsl:apply-templates select="row" />
  </table>
</xsl:template>

<xsl:template match="column_info">
  <th><xsl:value-of select="@name" /></th>
</xsl:template>

<xsl:template match="row">
  <tr><xsl:apply-templates /></tr>
</xsl:template>

<xsl:template match="column">
  <td><xsl:apply-templates /></td>
</xsl:template>

Something similar would apply for XSL-FO, but the names of the
elements that you generate would be different.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Complicated Table
    • DEV SEN - Tue, 1 Oct 2002 20:07:18 -0400 (EDT)
      • Jeni Tennison - Tue, 1 Oct 2002 20:25:15 -0400 (EDT) <=
        • DEV SEN - Tue, 1 Oct 2002 20:46:35 -0400 (EDT)
          • Geoff - Tue, 1 Oct 2002 21:11:35 -0400 (EDT)
      • Wendell Piez - Wed, 2 Oct 2002 00:26:25 -0400 (EDT)

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.