List Info

Thread: Re: Include subtitle in article toc




Re: Include subtitle in article toc
user name
2007-07-11 11:31:42
Each line in a TOC is generated using the template named
toc.line from 
html/autotoc.xsl.  This line does the title:

<xsl:apply-templates select="."
mode="titleabbrev.markup"/>

You could add a condition after that to
test="self::article" and add the 
dash and a

<xsl:apply-templates select="."
mode="subtitle.markup"/>

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobssagehill.net


----- Original Message ----- 
From: "Michael D. Cencula" <docbookcencula.com>
To: <docbook-appslists.oasis-open.org>
Sent: Tuesday, July 10, 2007 7:06 PM
Subject: [docbook-apps] Include subtitle in article toc


> How can I create a stylesheet customization so that a
section with
> <title>my title</title>
> <subtitle>my subtitle</subtitle>
>
> gets rendered in the html article TOC as
> my title - my subtitle
>
> Basically I'm trying to include the subtitle in the
table of contents
> following the title and a hyphen.
>
> Thanks,
>
> Mike Cencula
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org
>
>
> 



------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: Include subtitle in article toc
user name
2007-07-13 21:14:02
Bob,

Thank you very much for the pointers.  I added the following
xml to 
autotoc.xsl:

 <!--xsl:if test="self::article"-->
    <xsl:variable name="subtitle">
      <xsl:apply-templates select="."
mode="subtitle.markup"/>
    </xsl:variable>
    <xsl:if test="$subtitle != ''">
      -
      <xsl:apply-templates select="."
mode="subtitle.markup"/>
    </xsl:if>
  <!--/xsl:if-->

As you can see, I've got the test for
"self::article" commented out because i 
couldn't get that working.  I also tried using xsl:when
instead of xsl:if, 
but that generated a fatal indicating that when can't be
used in that place.

Any idea what's going on?

Thanks,

Mike Cencula

On Wednesday July 11 2007 12:31:42 pm Bob Stayton wrote:
> Each line in a TOC is generated using the template
named toc.line from
> html/autotoc.xsl.  This line does the title:
>
> <xsl:apply-templates select="."
mode="titleabbrev.markup"/>
>
> You could add a condition after that to
test="self::article" and add the
> dash and a
>
> <xsl:apply-templates select="."
mode="subtitle.markup"/>
>
> Bob Stayton
> Sagehill Enterprises
> DocBook Consulting
> bobssagehill.net
>
>
> ----- Original Message -----
> From: "Michael D. Cencula" <docbookcencula.com>
> To: <docbook-appslists.oasis-open.org>
> Sent: Tuesday, July 10, 2007 7:06 PM
> Subject: [docbook-apps] Include subtitle in article
toc
>
> > How can I create a stylesheet customization so
that a section with
> > <title>my title</title>
> > <subtitle>my subtitle</subtitle>
> >
> > gets rendered in the html article TOC as
> > my title - my subtitle
> >
> > Basically I'm trying to include the subtitle in
the table of contents
> > following the title and a hyphen.
> >
> > Thanks,
> >
> > Mike Cencula
> >
> >
------------------------------------------------------------
---------
> > To unsubscribe, e-mail:
docbook-apps-unsubscribelists.oasis-open.org
> > For additional commands, e-mail:
docbook-apps-helplists.oasis-open.org
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org



------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )