Next in thread → Next in month →

Re: [docbook-apps] How To: get HTML title when using inlinemediaobject for article title?

From
Bob Stayton <>
Date
2007-07-31T06:15:34+00:00
ID
061c01c7d33a$29dbc0e0$6400a8c0@totoro
Thread
Re: [docbook-apps] How To: get HTML title when using inlinemediaobject for article title?
If you look at how the <title> element is generated in html/docbook.xsl, 
you will see:

  <xsl:param name="title">
    <xsl:apply-templates select="$node" 
mode="object.title.markup.textonly"/>
  </xsl:param>

  <title>
    <xsl:copy-of select="$title"/>
  </title>

That mode is defined in common/gentext.xsl for all elements as:

<xsl:template match="*" mode="object.title.markup.textonly">
  <xsl:variable name="title">
    <xsl:apply-templates select="." mode="object.title.markup"/>
  </xsl:variable>
  <xsl:value-of select="normalize-space($title)"/>
</xsl:template>

The variable $title will have an <img> element in it as a result of 
mode="object.title.markup", but then the normalize-space() function is 
used, which only returns text and not empty elements like <img>.  You'll 
need to customize this mode to handle the mediaobject in a different way to 
get the text portion of it.

Bob Stayton
Sagehill Enterprises
DocBook Consulting



----- Original Message ----- 
From: "Johnson Earls" <>
To: <>
Sent: Monday, July 30, 2007 6:04 PM
Subject: [docbook-apps] How To: get HTML title when using inlinemediaobject 
for article title?


> Hello!
>
>    I have an article for which I am using a graphic for the title.  To
> do this, I did the following:
>
> <?xml version=1.0?>
> <!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
> 'docbookx.dtd'>
> <article>
>    <articleinfo>
>        <title>
>            <inlinemediaobject>
>                <imageobject>
>                    <imagedata format="GIF89a" fileref="..." />
>                </imageobject>
>                <textobject>
>                    <phrase>(text version of title)</phrase>
>                </textobject>
>            </inlinemediaobject>
>        </title>
>    </articleinfo>
> <!-- rest of document elided -->
> </article>
>
> When I render this into HTML, the <title> tag in the HTML header is
> blank.  Is there any way to get the <title> tag to include the contents
> of the <textobject> from the article title?
>
> I am using docbook-xsl-1.73.0 and xalan-j 2.7.0.
>
> Thanks in advance,
> - dfp
>
>
>
> ____________________________________________________________________________________
> Looking for a deal? Find great prices on flights and hotels with Yahoo! 
> FareChase.
> http://farechase.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>
>
>
Next in thread → Next in month →