Changes made by XMLmind to the docbook-xsl-1.78.1 distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 (DocBook 5: replace docbook-xsl-1.78.1 by docbook-xsl-ns-1.78.1)

  [1] mv docbook/xsl docbook/OLDxsl

      mv docbook/docbook-xsl-saxon.jar docbook/OLDdocbook-xsl-saxon.jar

  [2] tar zxvf /tmp/docbook-xsl-1.78.1.tar.gz

      mv docbook-xsl-1.78.1 docbook/xsl

      cd docbook/xsl

  [3] rm -rf assembly \
AUTHORS \
BUGS \
catalog.xml \
doc \
docsrc \
epub \
epub3 \
INSTALL \
install.sh \
log \
Makefile \
manpages \
NEWS \
NEWS.html \
NEWS.xml \
RELEASE-NOTES.pdf \
RELEASE-NOTES-TMP.xml \
RELEASE-NOTES.txt \
RELEASE-NOTES.xml \
REVISION \
roundtrip \
slides \
svn-commit.tmp \
tests \
TODO \
tools \
webhelp \
website \
xhtml5

  [4] mv extensions/saxon65.jar ../docbook-xsl-saxon.jar

      rm -rf extensions/

      DocBook 5: docbook-xsl-saxon.jar not useful. Already present in
      ../docbook/. However, !!!!!! MAKE SURE TO DELETE extensions/ !!!!!!

  [5] cp -r ../OLDxsl/css/ .

  [6] cp ../OLDxsl/make_image_lists .
      
      Run ./make_image_lists to create image lists in images/ and
      images/callouts/, images/colorsvg/. This script also delete .gif and 
      .tif files.

  [7] cd html/

      Changed param.xsl: 

        * callout.graphics from 1 to 0

        * Change all
          http://docbook.sourceforge.net/release/images/XXX to
          images/XXX

      Changed verbatim.xsl:

+---+
<!-- XSLTHL highlighting is turned off by default. See highlighting/README
     for instructions on how to turn on XSLTHL -->
<xsl:template name="apply-highlighting">
    <xsl:apply-templates/>
</xsl:template>
+---+

      becomes:

+---+
<xsl:include href="highlight.xsl"/>
+---+

      Copy CHANGES_MADE_BY_XMLMIND/html/highlight.xsl to html/

  [8] cd xhtml/, same changes as in html/. 

      cd xhtml-1_1/, same changes as in xhtml/.

  [9] cd fo/

       Changed param.xsl: 

         * Same as in html

         * admon.graphics.extension from .png to .svg

         * body.start.indent from 4pc to 0pt 
           (4pc may be nicer but in such case generated TOCs are buggy).

         * Title fonts are much too big (qanda.title.level1.properties,
           section.title.level1.properties, etc). 
           Change max factor from 2.0736 to 1.728.

         * Added to monospace.properties (included by 
           monospace.verbatim.properties)

+---+
  <xsl:attribute name="font-size">
    <xsl:value-of select="$body.font.master * 0.83"/>
    <xsl:text>pt</xsl:text>
  </xsl:attribute>
+---+

       Changed verbatim.xsl: same as in html.

       Changed table.xsl:

         * table-layout="auto" may be supported by some FO processors,
           unfortunately it is not supported by Saxon extension
           com.nwalsh.saxon.Table#adjustColumnWidths().

           Reverted to $table.width=100% when $explicit.table.width and
           $default.table.width are not specified.

+---+
      <xsl:when test="$default.table.width = ''">
        <xsl:text>100%</xsl:text>
      </xsl:when>
+---+

       Changed autotoc.xsl:

         * Declared 
           xmlns:xfc="http://www.xmlmind.com/foconverter/xsl/extensions"

         * Added to <fo:leader>:
+---+
                 xfc:tab-position="-({$toc.indent.width}pt+7.5mm)" 
                 xfc:tab-align="right"
+---+

       Changed graphics.xsl:

         * Change template image.content.type as follows. 
           The comments below explain why.

+---+
<xsl:template name="image.content.type">
  <!-- Do not convert @format to a content-type attribute when
       the graphics file has an extension.
       This is incompatible with the fact that XXE can convert 
       on the fly between different image formats. -->

  <xsl:variable name="ext">
    <xsl:if test="@fileref">
      <xsl:call-template name="filename-extension">
        <xsl:with-param name="filename" select="@fileref"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:variable>

  <xsl:if test="@format and $ext = ''">
    <xsl:call-template name="graphic.format.content-type">
      <xsl:with-param name="format" select="@format"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>
+---+

         * If scalefit=1 and both width and depth are specified, 
           both content-width and content-height must be set to
           scale-to-fit. If content-width is set to scale-to-fit and
           content-height is left to auto, XEP does not fit the image in the
           viewport but just adjusts the height to the width of the viewport
           in order to preserve the aspect ratio of the image. (XEP behavior
           does not seem nonsensical.)

           This required replacing template image.scalefit by two templates
           image.scalefitwidth and image.scalefitdepth.

+---+
<xsl:template name="image.scalefitwidth">
  <xsl:choose>
    <xsl:when test="$ignore.image.scaling != 0">0</xsl:when>
    <xsl:when test="@contentwidth">0</xsl:when>
    <xsl:when test="@scale">0</xsl:when>
    <xsl:when test="(@width or $default.image.width != '') and @scalefit">
      <xsl:value-of select="@scalefit"/>
    </xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template name="image.scalefitdepth">
  <xsl:choose>
    <xsl:when test="$ignore.image.scaling != 0">0</xsl:when>
    <xsl:when test="@contentdepth">0</xsl:when>
    <xsl:when test="@scale">0</xsl:when>
    <xsl:when test="@depth and @scalefit">
      <xsl:value-of select="@scalefit"/>
    </xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
  </xsl:choose>
</xsl:template>
+---+

           Invoke the above templates:

+---+
  <xsl:variable name="scalefitwidth">
    <xsl:call-template name="image.scalefitwidth"/>
  </xsl:variable>
  <xsl:variable name="scalefitdepth">
    <xsl:call-template name="image.scalefitdepth"/>
  </xsl:variable>
  ...
  <xsl:variable name="content.width">
    <xsl:call-template name="image.content.width">
      <xsl:with-param name="scalefit" select="$scalefitwidth"/>
      <xsl:with-param name="scale" select="$scale"/>
    </xsl:call-template>
  </xsl:variable>

  <xsl:variable name="content.height">
    <xsl:call-template name="image.content.height">
      <xsl:with-param name="scalefit" select="$scalefitdepth"/>
      <xsl:with-param name="scale" select="$scale"/>
    </xsl:call-template>
  </xsl:variable>
+---+

  [10] Update catalog.xml

* Alternate epub and webhelp style sheets:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  [1] rm -rf epub; cp -r CHANGES_MADE_BY_XMLMIND/epub epub

      (DocBook 5: copy ../../docbook/xsl/CHANGES_MADE_BY_XMLMIND/5epub.)

  [2] Modifications made to xhtml-1_1/

      [docbook.xsl] Changed:

---
<xsl:output method="xml" encoding="UTF-8" indent="no" 
  doctype-public="-//W3C//DTD XHTML 1.1//EN" 
  doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
---

          to:

---
<xsl:output method="xml" encoding="UTF-8" indent="no" />
---

          This is needed to be able to generate .opf and .ncx files not having
          a XHTML 1.1 doctype. Doing this does not prevent generated XHTML 1.1
          files from having XHTML 1.1 doctype (this is specified in
          chunker.xsl).

      [graphics.xsl] Attribute alt is required for elements such as img. So
          automatically generate something sensible for this attribute.

          in:

---
          <xsl:call-template name="process.image.attributes">
            <xsl:with-param name="alt">
              <xsl:choose>
              ...
---

          add:

---
                <xsl:otherwise>
                  <!-- alt is a required attribute -->
                  <xsl:call-template name="filename-basename">
                    <xsl:with-param name="filename" select="$output_filename"/>
                  </xsl:call-template>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:with-param>
---

  [3] rm -rf webhelp; cp -r CHANGES_MADE_BY_XMLMIND/webhelp webhelp

      (DocBook 5: copy ../../docbook/xsl/CHANGES_MADE_BY_XMLMIND/5webhelp.)

