[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Finding the "last-last"
Regarding your transformation, I'm not sure I understand. In a CALS table, a tgroup can have only one tbody. So the parent tbody will never have a following sibling. You just need to make sure the parent is a tbody and not a thead or tfoot: <xsl:template name="last-row"> <xsl:if test="not(self::*[following-sibling::*]) and parent::tbody"> <xsl:attribute name="rowsep">1</xsl:attribute> </xsl:if> </xsl:template> Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Chris Johnson" <cjohnson@capcollege.bc.ca> To: <docbook@lists.oasis-open.org> Sent: Thursday, February 12, 2004 5:36 PM Subject: [docbook] Finding the "last-last" > Hi all, > > I would like to have a border separating the <tfoot> from the last > <row> of the <tbody> of multiple <tgroup> elements in an > <informaltable>. The problem is that I don't know which row is the > *last* row before the <tfoot> element. The current context node is such > that I'm trying to test for the "last-last" element. In other words, I > need to test to see if the context node is the last one of its siblings, > *AND* that the parent of the context node is the last one of *its* > siblings. > > <latest-attempt> > > <xsl:template name="last-row"> > <xsl:if test="not(self::*[following-sibling::*]) and > not(parent::*[following-sibling::*])"> > <xsl:attribute name="rowsep">1</xsl:attribute> > </xsl:if> > </xsl:template> > > </latest-attempt> > > This doesn't work ... any thoughts on this much appreciated. > > desired output: > > <informaltable rowsep="0" frame="none" colsep="0"> > <tgroup rowsep="0" colsep="0" cols="4"> > <colspec colwidth="1*" colnum="1" colname="col1" align="left"/> > <colspec colwidth="3.1*" colnum="2" colname="col2" align="left"/> > <colspec colwidth="0.9*" colnum="3" colname="col3" > align="center"/> > <colspec colwidth="1*" colnum="4" colname="col4" align="center"/> > <thead> > <row> > <entry role="th-term" namest="col1" nameend="col2">Program > Requirements</entry> > <entry role="th-course-credits">Course Credits</entry> > <entry role="th-req-credits">Required Credits</entry> > </row> > </thead> > <tfoot> > <row> > <entry role="tf-total-prog-credits" namest="col1" > nameend="col2">Total Program Credits</entry> > <entry/> > <entry role="tf-credit-total">24.00</entry> > </row> > </tfoot> > <tbody> > <row><!-- ********* This row needs rowsep="1" **** ***** --> > <entry role="group-title" namest="col1" nameend="col2"> > <emphasis role="bold">Required Courses:</emphasis> > </entry> > <entry/> > <entry role="group-credits"> > <emphasis role="bold">24.00</emphasis> > </entry> > </row> > </tbody> > </tgroup> > <tgroup> > ... etc ... > </tgroup> > <tgroup> > ... etc ... > </tgroup> > </informaltable> > > This seems really kludgy - is there a way in docBook to set a border on > *top* of a row or tfoot? > > Cheers, > > > > Chris Johnson > > Web Developer > Capilano College > North Vancouver, Canada > > 604.986.1911 ext. 3455 > cjohnson@capcollege.bc.ca > > To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/. > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]