[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] column spanning issue
As you discovered, the current DocBook XSL stylesheets are written to the XSLT 1.0 spec. Although there is a backwards-compatibility mode for XSLT 2.0 processors, I think it is risky to use a 2.0 processor such as Saxon 8. Theoretically the use of <xsl:stylesheet version="1.0"> should tell the 2.0 processor to treat the variables as numbers when numbers are called for in an expression. I think that is what Saxon 8 should do in this case, but apparently it needs the data type to be explicit. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Jay Bryant" <jay@bryantcs.com> To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org> Sent: Wednesday, August 23, 2006 1:18 PM Subject: Re: [docbook-apps] column spanning issue > Well, it took some tracking, but I figured out that the issue arises > because > I'm using Saxon 8 for the XSLT processor. > > The culprit is the calculate.colspan template, scol and ecol, which > contains: > > <xsl:choose> > <xsl:when test="$ecol >= $scol"> > <xsl:value-of select="$ecol - $scol + 1"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="$scol - $ecol + 1"/> > </xsl:otherwise> > </xsl:choose> > > It worked when I made the following change: > > <xsl:choose> > <xsl:when test="number($ecol) >= number($scol)"> > <xsl:value-of select="$ecol - $scol + 1"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="$scol - $ecol + 1"/> > </xsl:otherwise> > </xsl:choose> > > Apparently, XSLT 2.0 (or perhaps just Saxon 8) has different rules for > converting strings to numbers. I'll post a message in the Saxon help list > and see what Mike Kay has to say. (Personally, I think the >= operator > should imply conversion from strings to numbers, but perhaps there's some > bit of the spec that says otherwise.) > > FWIW > > Jay Bryant > Bryant Communication Services > > > ----- Original Message ----- > From: "Bob Stayton" <bobs@sagehill.net> > To: "Jay Bryant" <jay@bryantcs.com>; <docbook-apps@lists.oasis-open.org> > Sent: Wednesday, August 23, 2006 2:10 PM > Subject: Re: [docbook-apps] column spanning issue > > >> Hi Jay, >> I'm unable to duplicate your problem. I cut and pasted your table into >> a >> document and processed with the fo/docbook.xsl stylesheet from 1.70.1 >> (and >> 1.69.1 and 1.68.1) and I got this output: >> >> <fo:table-body start-indent="0pt"> >> <fo:table-row> >> <fo:table-cell padding-left="2pt" padding-right="2pt" >> padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" >> border-right-style="solid" border-right-color="black" >> text-align="center" >> number-columns-spanned="4"> >> <fo:block>VER</fo:block> >> </fo:table-cell> >> <fo:table-cell padding-left="2pt" padding-right="2pt" >> padding-top="2pt" padding-bottom="2pt" border-right-width="0.5pt" >> border-right-style="solid" border-right-color="black" >> text-align="center" >> number-columns-spanned="4"> >> <fo:block>FAM</fo:block> >> </fo:table-cell> >> <fo:table-cell padding-left="2pt" padding-right="2pt" >> padding-top="2pt" padding-bottom="2pt" text-align="center" >> number-columns-spanned="8"> >> <fo:block>PARTNO</fo:block> >> </fo:table-cell> >> </fo:table-row> >> </fo:table-body> >> >> >> Bob Stayton >> Sagehill Enterprises >> DocBook Consulting >> bobs@sagehill.net >> >> >> ----- Original Message ----- >> From: "Jay Bryant" <jay@bryantcs.com> >> To: <docbook-apps@lists.oasis-open.org> >> Sent: Wednesday, August 23, 2006 11:31 AM >> Subject: [docbook-apps] column spanning issue >> >> >> > Note that I have removed all attributes except number-columns-spanned, >> > for >> > brevity's sake. I have also removed rows around the one causing the >> > problem. >> > >> > Given the following docbook fragment: >> > >> > <informaltable frame="none"> >> > <tgroup cols="16" align="left" colsep="1" rowsep="0"> >> > <colspec colname="c1" colwidth=".4in"/> >> > <colspec colname="c2" colwidth=".4in"/> >> > <colspec colname="c3" colwidth=".4in"/> >> > <colspec colname="c4" colwidth=".4in"/> >> > <colspec colname="c5" colwidth=".4in"/> >> > <colspec colname="c6" colwidth=".4in"/> >> > <colspec colname="c7" colwidth=".4in"/> >> > <colspec colname="c8" colwidth=".4in"/> >> > <colspec colname="c9" colwidth=".4in"/> >> > <colspec colname="c10" colwidth=".4in"/> >> > <colspec colname="c11" colwidth=".4in"/> >> > <colspec colname="c12" colwidth=".4in"/> >> > <colspec colname="c13" colwidth=".4in"/> >> > <colspec colname="c14" colwidth=".4in"/> >> > <colspec colname="c15" colwidth=".4in"/> >> > <colspec colname="c16" colwidth=".4in"/> >> > <tbody> >> > <row> >> > <entry align="center" namest="c1" nameend="c4">VER</entry> >> > <entry align="center" namest="c5" nameend="c8">FAM</entry> >> > <entry align="center" namest="c9" nameend="c16">PARTNO</entry> >> > </row> >> > </tbody> >> > </tgroup> >> > </informaltable> >> > >> > I expect the following output from the docbook.fo stylesheet: >> > >> > <!-- table markup trimmed for brevity's sake --> >> > <fo:table-cell number-columns-spanned="4"> >> > <fo:block>VER</fo:block> >> > </fo:table-cell> >> > <fo:table-cell number-columns-spanned="4"> >> > <fo:block>FAM</fo:block> >> > </fo:table-cell> >> > <fo:table-cell number-columns-spanned="8"> >> > <fo:block>PARTNO</fo:block> >> > </fo:table-cell> >> > >> > <!-- table markup trimmed for brevity's sake --> >> > >> > Instead, I get this: >> > >> > <!-- table markup trimmed for brevity's sake --> >> > <fo:table-cell number-columns-spanned="4"> >> > <fo:block>VER</fo:block> >> > </fo:table-cell> >> > <fo:table-cell number-columns-spanned="4"> >> > <fo:block>FAM</fo:block> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block>PARTNO</fo:block> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <fo:table-cell> >> > <fo:block/> >> > </fo:table-cell> >> > <!-- table markup trimmed for brevity's sake --> >> > >> > Note that, in addition to not spanning, the number of cells is wrong >> > (9 >> > rather than 8). >> > >> > What caused this and what can I do about it? >> > >> > Thanks. >> > >> > Jay Bryant >> > Bryant Communication Services >> > >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org >> > For additional commands, e-mail: >> > docbook-apps-help@lists.oasis-open.org >> > >> > >> > >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org > > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]