Docbook titlepage with 2 images

S

softino

Hi,

I am not sure if this is the correct newsgroup but I have a question
about docbook titlepages.

I am trying to create a title page for fo processing with two images.
One image at the top, and another at the bottom. In between the title
and subtitle.

I have added two mediaobjects to the book.xml:

----------book.xml---------
<book>
<title>Quality Environmental Management System (QEMS)</title>

<subtitle>Working with QEMS User Guide</subtitle>

<bookinfo>
<mediaobject>
<imageobject>
<imagedata fileref="images/titlepage_top.jpg" role="top" />
</imageobject>
</mediaobject>

<mediaobject>
<imageobject>
<imagedata fileref="images/titlepage_bottom.jpg" />
</imageobject>
</mediaobject>
....
---------------------------

and changed my version of titlepage.templates.xml to look like this
(only changed part):

---------titlepage.templates.xml-------
<t:titlepage t:element="book" t:wrapper="fo:block">
<t:titlepage-content t:side="recto">
<mediaobject/>
<title
t:named-template="division.title"
param:node="ancestor-or-self::book[1]"
text-align="center"
font-size="&hsize5;"
space-before="&hsize5space;"
font-weight="bold"
font-family="{$title.fontset}"/>
<subtitle
text-align="center"
font-size="&hsize4;"
space-before="&hsize4space;"
font-family="{$title.fontset}"/>
<mediaobject/>

</t:titlepage-content>
....
--------------------------------------
I process this template file with the templates/titlepage.xsl file.

When I process the book.xml file the images are show both before and
after the text. So I have 4 images instead of 2. I tried to use the
t:named-template and param: values on the <mediaobject/> elements but
only 1 template is created for both mediaobjects. Is it possible to have
two elements of the same name in a t:titlepage-contect element?

Sorry if this is not the right place to ask.

M.
 
T

Tuija Sonkkila

softino said:
I am trying to create a title page for fo processing with two images.
One image at the top, and another at the bottom. In between the title
and subtitle.

AFAIK, only one mediaobject is recognized in the title
page spec file. You could insert the other image e.g. by
customizing the subtitle template, something like this:

<xsl:template match="subtitle" mode="book.titlepage.recto.mode">
<xsl:apply-templates mode="titlepage.mode"/>
<fo:block>
<fo:external-graphic>
<xsl:attribute name="src">
<xsl:call-template name="fo-external-image">
<xsl:with-param name="filename"
select="$titlepage.bottom"/>
</xsl:call-template>
</xsl:attribute>
</fo:external-graphic>
</fo:block>
</xsl:template>

http://lists.oasis-open.org/archives/docbook-apps/ is
the default venue for DocBook questions

Best,
Tuija
 
M

Martijn

Thanks, I tried the predicate attribute but that didn't work either.
Eventually I just implemented my own template and referred to
mediaobject[1] and mediaobject[2]. Almost the same idea I guess.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top