Color text in topic
Posted: Fri Sep 12, 2014 10:33 am
Hi,
Exist a attribute that allows you to change colors on portions of text?
Thank you
Exist a attribute that allows you to change colors on portions of text?
Thank you
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>
Code: Select all
<entry outputclass="red">AAAAAA</entry>
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>