Re: [docbook-apps] Re: page-specific footer for chunked output

From
Bob Stayton <>
Date
2005-02-04T07:15:56+00:00
ID
041d01c50a89$5c7b02d0$6400a8c0@toshiro
Thread
Re: [docbook-apps] Re: page-specific footer for chunked output
----- Original Message ----- 
From: "Sam Steingold" <>
To: <>
Sent: Thursday, February 03, 2005 12:00 PM
Subject: [docbook-apps] Re: page-specific footer for chunked output


> > * Bob Stayton <> [2005-02-03 00:10:25 -0800]:
> >
> > Your "bookinfo/subtitle" path is taken relative to the current context
> > node, which is the current chunk being processed.
> > That should probably be "//bookinfo/subtitle".
>
> why not "/book/bookinfo/subtitle"?

Indeed, why not.  That works too, and is more precise.

> also, this strips out all the formating I have in the subtitle.
> e.g., "<subtitle>foo <emphasis>bar</emphasis> baz</subtitle>"
> is printed by
>
>  <xsl:if test="//bookinfo"><div class="bookinfo">
>    <hr width="100%"/><table width="100%">
>     <th><td align="left"><xsl:value-of select="//bookinfo/subtitle"/></td>
>      <td align="right"><xsl:value-of select="//bookinfo/date"/></td></th>
>  </table></div></xsl:if>
>
> as "<td>foo bar baz</td>" and not "<td>foo <em>bar</em> baz</td>"
> why?

That's because <xsl:value-of> will return the string value of a node, which
means just the text.  You want to apply-templates instead, so the <emphasis>
is processed by its template too. Just replace:
<xsl:value-of select="/book/bookinfo/subtitle"/>

<xsl:apply-templates select="/book/bookinfo/subtitle"/>

Bob Stayton
Sagehill Enterprises
DocBook Consulting