OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Re: [docbook] TOC with parents


On 23/11/2015 11:07pm, Aristedes Maniatis wrote:
> After a whole lot of debugging and following the code around, I see the real issue. The autotoc.xsl code calls <xsl:call-template name="href.target"> assuming that all links are always to children of the current page. Rather than using <xsl:call-template name="relative.path.link"> which would be more flexible.

Sorry, please ignore my previous email. I had gotten lost in the debugger and accidentally ended up in docbook.xsl rather than chunk.xsl. And of course, the singlepage output is only creating href targets to # anchors in the same page.

The chunked output is significantly harder to debug not least because Oxygen stops producing output in the debugger once the templates switch to different chunked files. The solution however is much simpler:

    <xsl:template name="component.toc">
        <xsl:param name="toc-context" select="."/>
        <xsl:param name="toc.title.p" select="true()"/>
        <xsl:for-each select="ancestor::book">
            <xsl:call-template name="division.toc">
                <xsl:with-param name="toc-context" select="$toc-context"/>
                <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
            </xsl:call-template>
        </xsl:for-each>
    </xsl:template>

The key line is <xsl:with-param name="toc-context" select="$toc-context"/>

Sorry for the noise, but I hope this helps the next person trying to do the same thing.


Ari


-- 
-------------------------->
Aristedes Maniatis
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]