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] 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
bobs@sagehill.net


----- Original Message ----- 
From: "Johnson Earls" <darkfoxprime@yahoo.com>
To: <docbook-apps@lists.oasis-open.org>
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: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
> 




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