<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    xmlns:sp    = "http://docbook.org/ns/docbook" version="5.0"
    xmlns:xsl   = "http://www.w3.org/1999/XSL/Transform"
    xmlns:fo    = "http://www.w3.org/1999/XSL/Format"
    xmlns:l     = "http://docbook.sourceforge.net/xmlns/l10n/1.0">

  <xsl:import
    href    = "../docbook-xsl-1.73.0/fo/docbook.xsl" />

  <xsl:param
    name    = "paper.type"
    select  = "'A4'" />

  <xsl:param
    name    = "fop1.extensions"
    select  = "1" />

  <xsl:param
    name    = "chapter.autolabel"
    select  = "1" />

<!-- Change the Chapter color -->
<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
  <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
            xsl:use-attribute-sets="chapter.titlepage.recto.style"
            color="red">
    <xsl:call-template name="component.title">
      <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
    </xsl:call-template>
  </fo:block>
</xsl:template>

<!-- Change the Chapter text ***DOES NOT WORK*** -->
  <xsl:param
    name    = "local.l10n.xml"
    select  = "document('')"/>

  <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">

  <l:l10n language="en">
    <l:context name="xref-number-and-title">
      <l:template name="chapter" text="%t"/>
    </l:context>
  </l:l10n>
  </l:i18n>

</xsl:stylesheet>
