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

Borders on column groups

Subject: Borders on column groups
From: Gustaf Liljegren <gustafl@xxxxxxxxxx>
Date: Fri, 07 Jun 2002 00:29:17 +0200
colgroup border
Hello all,

Thanks Joerg and David, for solving the "Borders on row groups" problem.
Now I have a question related to column groups, which seem to be much
harder. For others, I quote the first <p> from last message:

<quote>I constructed a subset of the table model in XHTML 1.1. I like the
frame
(border around table) and rules (borders inside table) attributes, and want
to make them work in an XSL-FO stylesheet. The rules attribute can be set
to "groups", which means there will be borders only to separate column and
row groups.</quote>

Now I'm doing the vertical rules inside the table. At the setting
rules="groups" I want to have border-right on all last <col> in <colgroup>
elements, except on the last group. I know <col> may have a span attribute
too, but I removed that option in my subset, and no stand-alone <colgroup>
elements are allowed either. So, a column group consists of one or more
<col> elements in a <colgroup> element.

The XML structure looks like this:

  <table frame="none" rules="groups" width="100%">
    <caption>frame="none" rules="groups"</caption>
    <colgroup>
      <col width="*"/>
    </colgroup>
    <colgroup>
      <col width="*"/>
      <col width="*"/>
      <col width="*"/>
    </colgroup>
    <thead>
      <tr>
        <th></th>
        <th>South-East Asia</th>
        <th>Scandinavia</th>
        <th>Axis of Evil</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th>1998</th>
        <td>16000</td>
        <td>15000</td>
        <td>14000</td>
      </tr>
      <tr>
        <th>1999</th>
        <td>18000</td>
        <td>17000</td>
        <td>14000</td>
      </tr>
    </tbody>
    <tbody>
      <tr>
        <th>2000</th>
        <td>21000</td>
        <td>20000</td>
        <td>14000</td>
      </tr>
      <tr>
        <th>2001</th>
        <td>24000</td>
        <td>23000</td>
        <td>14000</td>
      </tr>
    </tbody>
  </table>

In this case, the result should be a vertical rule after the first column.

I imagine that the border-right should be drawn if: the <table> ancestor's
<col> element that has the same number (based on document order) as the
position of the current element in the <tr>, and if this <col> element is
part of a <colgroup> element, and the <colgroup> is not the last one. I've
no idea how to say that in XPath!

I prepared an <xsl:if> element that I hope someone can help me fill in:

  <xsl:if test="ancestor::table[@rules='groups']">
    <xsl:if test=" ">
      <xsl:attribute name="border-right">
        <xsl:value-of select="$border"/>
      </xsl:attribute>
    </xsl:if>
  </xsl:if>

Gustaf


 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.