Changing font-size of the list used in table cells
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 8
- Joined: Thu Apr 14, 2022 8:37 am
Changing font-size of the list used in table cells
Post by girishkanmas »
Hi,
Through my custom plugin, I did the following to change font-size of the <li> elements used in the <table>:
Added following in the <custom-plugn>\cfg\fo\attrs]\custom.xsl file:
And added following in the <custom-plugn>\cfg\fo\xsl\custom.xsl
But it's not working. The generated PDF is using the default font-size to format lists in tables.
Through my custom plugin, I did the following to change font-size of the <li> elements used in the <table>:
Added following in the <custom-plugn>\cfg\fo\attrs]\custom.xsl file:
Code: Select all
<xsl:attribute-set name="table_ul" use-attribute-sets="common.block">
<xsl:attribute name="font-size">8pt</xsl:attribute>
</xsl:attribute-set>
Code: Select all
<xsl:template match="*[contains(@class,' topic/entry ')]/*[contains(@class,' topic/li ')]">
<fo:list-item>
<fo:list-item-label/>
<fo:list-item-body>
<fo:block xsl:use-attribute-sets="table_ul">
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Changing font-size of the list used in table cells
Hi,
Maybe you can create a very small DITA Map and topics sample to quickly publish and then try to debug the problem, for example in the Oxygen transformation scenario in the Parameters tab you can set the parameter "clean.temp" to value "no", then publish.
After this, look in the transformation temporary files folder at the generated "topic.fo" file and try to find that XSL-FO element produced by your customization.
Also inside an xsl:template you can add <xsl:message> elements to send a message to the console view.
Looking at your template match:
<xsl:template match="*[contains(@class,' topic/entry ')]/*[contains(@class,' topic/li ')]">
you seem to be matching a <li> element placed directly inside a table <entry> but usually the <li> is inside an <ul> or <ol>, so maybe you actually want to match:
<xsl:template match="*[contains(@class,' topic/entry ')]/*[contains(@class,' topic/ul ')]"/*[contains(@class,' topic/li ')]">
Regards,
Radu
Maybe you can create a very small DITA Map and topics sample to quickly publish and then try to debug the problem, for example in the Oxygen transformation scenario in the Parameters tab you can set the parameter "clean.temp" to value "no", then publish.
After this, look in the transformation temporary files folder at the generated "topic.fo" file and try to find that XSL-FO element produced by your customization.
Also inside an xsl:template you can add <xsl:message> elements to send a message to the console view.
Looking at your template match:
<xsl:template match="*[contains(@class,' topic/entry ')]/*[contains(@class,' topic/li ')]">
you seem to be matching a <li> element placed directly inside a table <entry> but usually the <li> is inside an <ul> or <ol>, so maybe you actually want to match:
<xsl:template match="*[contains(@class,' topic/entry ')]/*[contains(@class,' topic/ul ')]"/*[contains(@class,' topic/li ')]">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 8
- Joined: Thu Apr 14, 2022 8:37 am
Re: Changing font-size of the list used in table cells
Post by girishkanmas »
Hi Radu,
I tried using your suggested condition:
The PDF is still using the default font. Looks like the <li> element is overridden by the lower-level element with default font-size. How to avoid such overriding?
I tried using your suggested condition:
Code: Select all
<xsl:template
match="*[contains(@class,' topic/entry ')]/*[contains(@class,' topic/ul ')]/*[contains(@class,' topic/li ')]">
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Changing font-size of the list used in table cells
Hi,
The closer ancestor element containing a font-size attribute to the text will always win. You probably need to match also on that element and increase that font size.
Regards,
Radu
The closer ancestor element containing a font-size attribute to the text will always win. You probably need to match also on that element and increase that font size.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 8
- Joined: Thu Apr 14, 2022 8:37 am
Re: Changing font-size of the list used in table cells
Post by girishkanmas »
Hi Radu,
Thank you very much for your suggestion. It worked!
I used the condition as follows:
Regards,
Girish Kanmas
Thank you very much for your suggestion. It worked!
I used the condition as follows:
Code: Select all
<xsl:when test="ancestor::*[contains(@class, ' topic/entry ')]">
Girish Kanmas
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