#1253 Chunker behaviour seems broken since 1.77.0

closed-fixed
XSL (1066)
5
2014-01-20
2012-08-31
AndreyParamonov
No

The "make-relative-filename" template has parameter "base.dir" and up to 1.77.0 release it operated on this passed in parameter.
From 1.77.0 on the template doesn't honour this parameter but operates on "chunk.base.dir" parameter instead. This virtually disables conditional base.dir passing logic in many templates calling "make-relative-filename" template and results in incorect paths written out in htmlhelp project file(hhp)

Discussion

  • Robert Stayton
    Robert Stayton
    2012-10-19

    I'm not understanding what the problem is. I am able to use the htmlhelp stylesheet from version 1.77.1 and it generates a working .chm file when I compile it in HTML Help Workshop. The directory links seem to be ok. I tried with manifest.in.base.dir set to 1 or 0, and both produced working .chm files.

    The chunk.base.dir parameter is an internal param that corrects for a missing trailing slash on the base.dir param. Otherwise, it is same as base.dir.

    I'm not disputing that you saw something wrong, I just cannot find it yet. Can you describe in more detail how this virtually disables conditional base.dir passiing logic? In which templates, for example?

     
  • Robert Stayton
    Robert Stayton
    2012-10-19

    • assigned_to: nobody --> bobstayton
     
  • Here is the "make-relative-filename" declaration.
    It has a base.dir parameter with default value equals to current directory
    <xsl:template name="make-relative-filename">
    <xsl:param name="base.dir" select="'./'"/> <!--chunker.xsl line numb. 56 as of 1.77.1-->
    <xsl:param name="base.name" select="''"/>

    But the template itself doesn't use the $base.dir passed in parameter
    It uses $chunk.base.dir instead. something like this
    <xsl:value-of select="concat($chunk.base.dir,$base.name)"/>
    <!--chunker.xsl line numbs. 63, 69, 78, as of 1.77.1-->

    The version of template prior to 77.0 used the $base.dir parameter

    Now look at how this template is invoked( All line numbers reffer to 1.77.1 version )
    htmlhelp-common.xsl at line 170

    <xsl:call-template name="make-relative-filename">
    <xsl:with-param name="base.dir">
    <xsl:if test="$manifest.in.base.dir = 0">
    <xsl:value-of select="$chunk.base.dir"/>
    </xsl:if>

    The logic assumes default directory to be used if $manifest.in.base.dir=1 but it
    results in $chunk.base.dir being always substitued .

    .....
    THe same applies to chunk-code.xsl ( lines 616, 636, 655 )

    The chunk-code.xsl at line 679 has this fragment.
    <xsl:call-template name="make-relative-filename">
    <xsl:with-param name="base.dir" select="''"/>
    Again, it doesn't use empty string - it returns $chunk.base.dir instead.

    At some places the behaviour doesn't change - the $chunk.base.dir variable itself is passed to template
    <xsl:call-template name="make-relative-filename">
    <xsl:with-param name="base.dir" select="$chunk.base.dir"/>

     
  • Robert Stayton
    Robert Stayton
    2012-10-29

    • status: open --> pending-fixed
     
  • Robert Stayton
    Robert Stayton
    2012-10-29

    Ah, now I see the problem: confusion between a global parameter and a local template parameter. I agree the solution is to fix make-relative-filename so that it only uses its local base.dir param instead of the global chunk.base.dir param. If a calling template needs chunk.base.dir it should pass it in the local base.dir template param. I checked in that fix, so it should be working in the latest snapshots. Thanks for the report.

     
  • Robert Stayton
    Robert Stayton
    2014-01-20

    • Status: pending-fixed --> closed-fixed