Here should go questions about transforming XML with XSLT and FOP.
- Posts: 1
- Joined: Fri May 15, 2020 3:43 pm
I am busy transforming DocBook XML to EPUB3 and HTML.
I want to add a class to table cells (td).
This is my XSL template in the customization layer:
Code: Select all
<xsl:template match="td[@role = 'breedte-50']">
<td xmlns="http://www.w3.org/1999/xhtml" class="breedte-50">
<xsl:copy-of select="@*[local-name() != 'role' and local-name() != 'class']"/>
The expected out is:
Unfortunately, DocBook XSL ignores this rule and just places <td> in the output.
Does anyone know why this happens? Is it possible to add classes to <td>?
Thanks in advance!
- Posts: 6981
- Joined: Fri Jul 09, 2004 5:18 pm
Your XSLT customization is applied over DocBook content. DocBook has two types of tables, CALS tables and HTML tables. For CALS tables the cell name is "entry" and for HTML tables the cell name is "td". In your case are all the DocBook tabes HTML-tables?
You can try to add an xsl:message inside the "xsl:template", when publishing it should show up if your template is called. Otherwise it means your XSLT template is not called at all.
We (the Oxygen team) do not work much with DocBook, there seems to be a small section in the DocBook XSLT customization manual about generating custom @class attribute values:
http://sagehill.net/docbookxsl/HtmlCust ... lassValues
Also there is a DocBook Mailing list:
on which you can ask DocBook specific questions, it has lots of people registered on it who use DocBook everyday.
<oXygen/> XML Editor