Сell vertical borders not showing
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 12
- Joined: Thu Jan 20, 2022 8:05 am
Сell vertical borders not showing
Post by Yuriy_1977 »
Hi!
I use custom.xsl against css.
I need to display an empty row after the header before the body in every table.
This row must have the same number of cells as the last header row.
So I am using the following template
But cell vertical borders not showing. I tried to use many border-properties but it didn't help.
Need help, advice
.
Thanks in advance.
I use custom.xsl against css.
I need to display an empty row after the header before the body in every table.
This row must have the same number of cells as the last header row.
So I am using the following template
Code: Select all
<xsl:template match="*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ') and position()=last()]">
<fo:table-row>
<xsl:apply-templates/>
</fo:table-row>
<fo:table-row>
<xsl:for-each select="entry">
<fo:table-cell height="5mm" xsl:use-attribute-sets="thead.row.entry" border-width="1mm"/>
</xsl:for-each>
</fo:table-row>
</xsl:template>
Need help, advice

Thanks in advance.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Сell vertical borders not showing
Hi,
Can you do some debugging on your side? Maybe add an xsl:message inside your xsl:template to see if it gets called?
If the template gets called, you can set the "clean.temp=no" transformation parameter and look in the transformation temporary files folder at the generated "topic.fo" to see if your content was included in the xsl:fo table structure.
Also maybe you can try to replace:
with which should apply the base template which handles rows.
Regards,
Radu
Can you do some debugging on your side? Maybe add an xsl:message inside your xsl:template to see if it gets called?
If the template gets called, you can set the "clean.temp=no" transformation parameter and look in the transformation temporary files folder at the generated "topic.fo" to see if your content was included in the xsl:fo table structure.
Also maybe you can try to replace:
Code: Select all
<fo:table-row>
<xsl:apply-templates/>
</fo:table-row>
Code: Select all
<xsl:next-match/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Thu Jan 20, 2022 8:05 am
Re: Сell vertical borders not showing
Post by Yuriy_1977 »
If I replace my code with
I get the same in the output file: cell vertical borders not showing
The answer was in the topic.fo: I copied from the topic.fo all attributes of a good cell and found out the required attribute for my template cell:
Thanks a lot for your reply!
Code: Select all
<xsl:next-match/>
The answer was in the topic.fo: I copied from the topic.fo all attributes of a good cell and found out the required attribute for my template cell:
Code: Select all
border-end-style="solid"
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Сell vertical borders not showing
Hi,
So:
Maybe as another approach you could copy the last row's XSL:FO content as it is but without the text inside the cells. Something like this (but I have not tested if it works):
Regards,
Radu
So:
Using xsl:next-match is better. You can look in the XSLT stylesheet used by the base PDF plugin and find the original template which matches "*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ')"", as you see it generates an <fo:table-row> but it has certain attributes on it. So if you override it and do not generate the same attributes on the table-row, you might break things. For example a DITA table row may have an ID attribute set on it, attribute which may be used when linking to the row from another part of the topic. If you do not generate an ID for the row in the XSL-Fo output, you may break a link. So using "xsl:next-match" you apply exactly the same processing in the base to generate the next to last row exactly as it was generated before.If I replace my code with <xsl:next-match/>I get the same in the output file: cell vertical borders not showing
This may depend on the individual table, DITA tables have various attributes which specify if the user creating the table wants borders all around, if they want borders between rows and cells. So what you did may not be good in all cases.The answer was in the topic.fo: I copied from the topic.fo all attributes of a good cell and found out the required attribute for my template cell:
border-end-style="solid"
Maybe as another approach you could copy the last row's XSL:FO content as it is but without the text inside the cells. Something like this (but I have not tested if it works):
Code: Select all
<xsl:template match="*[contains(@class, ' topic/thead ')]/*[contains(@class, ' topic/row ') and position()=last()]">
<xsl:variable name="lastRow">
<xsl:next-match/>
</xsl:variable>
<!-- Copy the last row as it is -->
<xsl:copy-of select="$lastRow"/>
<!-- Copy the last row without text -->
<xsl:apply-templates select="$lastRow" mode="removeText"/>
</xsl:template>
<!-- Ignore text -->
<xsl:template match="text()" mode="removeText"/>
<xsl:template match="* | @*" mode="removeText">
<xsl:copy>
<xsl:apply-templates select="* | @*"/>
</xsl:copy>
</xsl:template>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service