Subject: [xsl] problem with table From: Eldho George <georgee@xxxxxxxxxxx> Date: Mon, 20 Sep 2004 15:21:07 +0530 |
Hai all I am working with a project of converting a web page into pdf. I am working with Apache FOP,Eclipse 3.0,JBoss 3.2.3.I am reading the html content and make it as xhtml.Then i apply a style sheet to getting the formatting object. I created template for most of the html4.0 tags using xsl-fo.I got the pdf and it works fine.(I am new in xsl and xsl-fo) Actually my probelm is with table.Iwould like to know whether <fo:table-column> is compulsory? I tried without <fo:table-column>But i could not get the table visible in the pdf format. I have some problem with <fo:table-column>.Suppose i am using different table structure such as first <tr> contains 3 <td>.Second <tr> contains 4 <td>.Then 3<tr> onwards it contains 6 <td> The following is my table template. <xsl:for-each select="tr/th|tr/td|thead/tr/th|thead/tr/td"> <fo:table-column/> </xsl:for-each> But it showing some content overflow error.Suppose i am using tr[3]/th instead of tr/th it will work fine with above table structure. But i cannot specify tr[3].Because i want to make it general one and it will work with all type of table structure. Without specifying<fo:table-column> it is possible.Any other solution is there.Please help me .Following is my table template <xsl:attribute-set name="table-structure"> <xsl:attribute name="table-layout">fixed</xsl:attribute> <xsl:attribute name="space-before">10pt</xsl:attribute> <xsl:attribute name="space-after">10pt</xsl:attribute> </xsl:attribute-set> <fo:table xsl:use-attribute-sets="table-structure"> <xsl:call-template name="tablealign"/> //This template i already created <xsl:call-template name="tableborder"/> //This template i already created <xsl:for-each select="tr/th|tr/td|thead/tr/th|thead/tr/td"> <fo:table-column/> </xsl:for-each> </fo:table> ****************************Template for tr******************** <xsl:template match="tr"> <fo:table-row keep-with-next="always"> <xsl:apply-templates select="*|text()"/> </fo:table-row> </xsl:template> ****************************Template for th******************** <xsl:template match="th"> <fo:table-cell hyphenate="true"> <fo:block font-weight="bold"> <xsl:apply-templates select="*|text()"/> </fo:block> </fo:table-cell> </xsl:template> ****************************Template for td******************** <xsl:template match="td"> <fo:table-cell hyphenate="true"> <fo:block > <xsl:apply-templates select="*|text()"/> </fo:block> </fo:table-cell> </xsl:template> ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] flatten tree, Jan Limpens | Thread | Re: [xsl] problem with table, G. Ken Holman |
Re: [xsl] flatten tree, Jan Limpens | Date | [xsl] problem with table-column, Eldho George |
Month |