Docbook XSL overrules templates for adding class to td
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Fri May 15, 2020 3:43 pm
Docbook XSL overrules templates for adding class to td
Post by michelvandenburg »
Hello everyone,
I am busy transforming DocBook XML to EPUB3 and HTML.
I want to add a class to table cells (td).
The input:
This is my XSL template in the customization layer:
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!
Michel
I am busy transforming DocBook XML to EPUB3 and HTML.
I want to add a class to table cells (td).
The input:
Code: Select all
<td role="breedte-50">
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']"/>
<xsl:apply-templates/>
</td>
</xsl:template>
Code: Select all
<td class="breedte-50">
Does anyone know why this happens? Is it possible to add classes to <td>?
Thanks in advance!
Michel
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Docbook XSL overrules templates for adding class to td
Dear Michel,
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:
https://docbook.org/guidelines
on which you can ask DocBook specific questions, it has lots of people registered on it who use DocBook everyday.
Regards,
Radu
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:
https://docbook.org/guidelines
on which you can ask DocBook specific questions, it has lots of people registered on it who use DocBook everyday.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Fri May 15, 2020 3:43 pm
Re: Docbook XSL overrules templates for adding class to td
Post by michelvandenburg »
Dear Radu,
Thank you for your reply. I've found that the custom class value works for most of the elements, except for tables. I've contacted Norman Walsh, who probably knows everything there is to know about the docbook XSL files.
Kind regards,
Michel
Thank you for your reply. I've found that the custom class value works for most of the elements, except for tables. I've contacted Norman Walsh, who probably knows everything there is to know about the docbook XSL files.
Kind regards,
Michel
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