OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] setting a particular table's column widths with xsl


Hi Matt,
The stylesheets call a template named 'generate.colgroup', which recursively passes 
through the columns and calls a template named 'generate.col' for each column of the 
table.  The 'generate.col' template outputs one fo:table-column element, normally 
using the width information provided by the XML input.

You could customize the 'generate.colgroup' template from fo/table.xsl to first 
compute the tabstyle using this utility template included in DocBook XSL:

<xsl:variable name="tabstyle">
  <xsl:call-template name="tabstyle"/>
</xsl:variable>

Then customize 'generate.colgroup' to add an xsl:when statement for your custom 
tabstyle value to output the set of four fo:table-column elements for your special 
tables, instead of calling 'generate.col'.

Or you could customize 'generate.col' to handle each column separately based on the 
tabstyle value it computes.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Matt Dew" <marcoz@osource.org>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, April 08, 2011 11:35 AM
Subject: [docbook-apps] setting a particular table's column widths with xsl


> Hi again all,
>    I've got a particular type of table that I want to set column widths on via xsl 
> rather than having to do it in the xml source.
>
> The reason is that I have _lots_ of xml files that will use this type of table and I 
> don't want to have to maintain this if/when we change the table layout.
>
> The html is easy with the css.
> I'm having a problem with the pdf/ps output.
>
> I don't want to have to use 'colwidth' like this:
> <informaltable tabstyle='encoding'>
>   <tgroup cols='4' align='left'>
>     <colspec colname='c1'  colwidth="1.0*"/>
>     <colspec colname='c2'  colwidth="3.0*"/>
>     <colspec colname='c3'  colwidth="2.0*"/>
>     <colspec colname='c4'  colwidth="3.0*"/>
>     <thead>
>       <row>
> ...
>
> I want to be able to just do:
> <informaltable tabstyle='encoding'>
>   <tgroup cols='4' align='left'>
>     <colspec colname='c1'/>
>     <colspec colname='c2'/>
>     <colspec colname='c3'/>
>     <colspec colname='c4'/>
>
>   <thead>
>     <trow>
> ...
>
>
> I cant' figure out how to do this.
> I've seen examples on using the table.layout template and such but I'm not having 
> any luck.
>
> IE:
> <xsl:template name="table.layout">
>   <xsl:param name="table.content"/>
>   <fo:table width="100%" table-layout="fixed" column-width="1.0">
>     <fo:table-column column-width="proportional-column-width(1.0)"/>
>     <fo:table-column/>
>     <fo:table-column column-width="proportional-column-width(1.0)"/>
>     <fo:table-column/>
> ...
>
>
> Can someone point me in the right direction?
> thanks,
> marcoz
>
> ---------------------------------------------------------------------
> 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]