Dear Mr.Shafie,

Below is my second mail with the solution (added some more details, I hope
it will be understandable). I just noticed that the mail title I used is
wrong, as the question is actually about footers and not headers.

"Just to say that I have found a solution by creating variables
(righteven, lefteven) in pagination.xsl. Then I could use fo :inline in
footer tables :

<xsl:if test="exists($fle) or exists($fce) or exists($fre)">
      <fo:static-content flow-name="even-page-footer">
        <xsl:call-template name="tabularHeader">
          <xsl:with-param name="lefteven" select="$fle"/>
          <xsl:with-param name="center" select="$fce"/>
          <!-- ADDED   --><xsl:with-param name="righteven"
select="$fre"/><!-- ADDED   -->
          <xsl:with-param name="isFooter" select="true()"/>
          <xsl:with-param name="leftWidth" select="$fleW"/>
          <xsl:with-param name="centerWidth" select="$fceW"/>
          <xsl:with-param name="rightWidth" select="$freW"/>
        </xsl:call-template>
      </fo:static-content>
</xsl:if>

<xsl:template name="tabularHeader">
    <xsl:param name="left" select="()"/>
    <xsl:param name="lefteven" select="()"/>
    <xsl:param name="center" select="()"/>
    <xsl:param name="right" select="()"/>
    <!-- ADDED   --><xsl:param name="righteven" select="()"/><!-- ADDED
-->
    <xsl:param name="isFooter" select="false()"/>
    <xsl:param name="leftWidth" select="'2'"/>
    <xsl:param name="centerWidth" select="'6'"/>
    <xsl:param name="rightWidth" select="'2'"/><!--
[...]--></xsl:template>

    <!-- ADDED   -->
   <xsl:when test="exists($righteven)">
       <fo:inline color="#0C65AF"><xsl:copy-of
select="$righteven"/></fo:inline>
   </xsl:when>
   <!-- ADDED   -->
   <xsl:when test="exists($right)">
       <!-- MODIFIED  --> <fo:inline font-weight="bold"><xsl:copy-of
select="$right"/></fo:inline><!-- MODIFIED  -->
   </xsl:when>

Then I did the same with left variables. Notice that I should have
replaced $right by $rightodd for convenience and better understanding of
the code, but I did not due to time reasons."


Best regards and have a great day !

-----Message d'origine-----
De : Hussein Shafie [mailto:[email protected]]
Envoyé : mercredi 16 septembre 2015 09:14
À : Vincent Knaub <[email protected]>
Cc : [email protected]
Objet : Re: [ditac] Change header color depending on text ?

On 09/15/2015 12:17 PM, Vincent Knaub wrote:
>
> First of all, please excuse me if I am not following the good way to
> ask for support, and for the basicity of my question (I’m a real
> beginner with FO).
>
> I am converting a DITA file to PDF by using XML Mind, and trying to
> modify the already existing XSL-FO files to get the desired page
> layout and style.
>
> I’m modifying footers so the page number is always on the outside of
> the page, and the company name is always on the inside, whether it’s
> an odd or even page. No problem with that so far.
>
> But I would also like the company name to be always displayed in blue.
> I cannot manage to do that with the footer-right and left attribute
> sets, as it changes color for the corresponding footer side with no
> importance given to whether the company name or the page number is
displayed.
>
> I have tried several solutions since yesterday, but none worked :
>
> ·Created parameters called « footer-…-pagecount » and «
> footer-…-company » in foParams.xsl and changed pagination.xsl
> accordingly
>
> ·Created attribute sets in pagination.xsl and added a condition (if
> $footer-right contains ‘company name’, use color blue) to display the
> footer right cell with the right attribute set
>
> Is there a simple solution to make it work within the XSL-FO provided
> with XML Mind ? Or what would be the best way to achieve this ?
>
> Thank you very much in advance for your answer and for this awesome
> software !

It seems that you have found a way to achieve what you want. We have
received your second message before this one (i.e. your solution before
your problem). Our moderator unfortunately deleted this second message by
mistake. Please be kind enough to resend your second message to this
mailing list. Sorry for the inconvenience and also thanks for the
compliments!

--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support

Reply via email to