Color text in topic
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 9420
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Color text in topic
Hi,
No, you would need to add a <ph> element with a certain @outputclass attribute value around that portion of text and then from the XSLs or from the CSS in case of the XHTML output match that output class and change the foreground color.
Regards,
Radu
No, you would need to add a <ph> element with a certain @outputclass attribute value around that portion of text and then from the XSLs or from the CSS in case of the XHTML output match that output class and change the foreground color.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 147
- Joined: Sat Oct 19, 2013 8:21 am
Re: Color text in topic
hi,
In topic i indicate :
In custom file i indicate :
In resut PDF not color RED ?
thank you
In topic i indicate :
Code: Select all
<p>blablablas <ph outputclass="font-color-red">I am red</ph></p>
Code: Select all
<xsl:template name="decoration">
<xsl:choose>
<xsl:when test="@outputclass='font-color-red'">
<xsl:attribute name="color">#8E2323</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- call decoration -->
<xsl:template match="*[contains(@class,' topic/ph ')]">
<fo:inline xsl:use-attribute-sets="ph">
<xsl:call-template name="decoration"/>
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
thank you
-
- Posts: 9420
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Color text in topic
Hi,
You could try to add xsl:messages in the XSLT customization to see after the publishing is finished in the ANT console output if your template is being called.
Regards,
Radu
You could try to add xsl:messages in the XSLT customization to see after the publishing is finished in the ANT console output if your template is being called.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9420
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Color text in topic
Hi,
Is this a question or is this a statement?
The color attribute in XSL-FO should handle colors specified with the hexadecimal notation.
You can also edit the transformation scenario and set the parameter clean.temp to "no", then after the transformation look in the temporary files folder at a file called topic.fo which is the resulting XSL-FO file and see if the color attribute properly appeared on the fo:inline.
Regards,
Radu
Is this a question or is this a statement?
The color attribute in XSL-FO should handle colors specified with the hexadecimal notation.
You can also edit the transformation scenario and set the parameter clean.temp to "no", then after the transformation look in the temporary files folder at a file called topic.fo which is the resulting XSL-FO file and see if the color attribute properly appeared on the fo:inline.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9420
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Color text in topic
Hi,
You can probably also set the @outputclass attribute on a table entry like:
then in the XSL:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\tables.xsl
make modifications to the template which matches table body entries so that it looks for that attribute:
Regards,
Radu
You can probably also set the @outputclass attribute on a table entry like:
Code: Select all
<entry outputclass="red">AAAAAA</entry>
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\tables.xsl
make modifications to the template which matches table body entries so that it looks for that attribute:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]/*[contains(@class, ' topic/entry ')]">
<fo:table-cell xsl:use-attribute-sets="tbody.row.entry">
<xsl:if test="@outputclass">
<xsl:attribute name="background-color"><xsl:value-of select="@outputclass"/></xsl:attribute>
</xsl:if>
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="applySpansAttrs"/>
<xsl:call-template name="applyAlignAttrs"/>
<xsl:call-template name="generateTableEntryBorder"/>
<fo:block xsl:use-attribute-sets="tbody.row.entry__content">
<xsl:call-template name="processEntryContent"/>
</fo:block>
</fo:table-cell>
</xsl:template>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
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