Docbook titlepage with 2 images

Discussion in 'XML' started by softino, Jul 11, 2005.

  1. softino

    softino Guest

    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.
    softino, Jul 11, 2005
    #1
    1. Advertising

  2. softino <> wrote:
    > 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
    Tuija Sonkkila, Jul 26, 2005
    #2
    1. Advertising

  3. softino

    Martijn Guest

    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.

    Tuija Sonkkila wrote:
    > softino <> wrote:
    >
    >>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
    Martijn, Jul 27, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dominic Suter
    Replies:
    1
    Views:
    1,313
    Dominic Suter
    Jun 22, 2005
  2. Thomas Kellerer

    Ant, DocBook, XSLT and JDK 1.5

    Thomas Kellerer, Nov 1, 2005, in forum: Java
    Replies:
    3
    Views:
    1,928
    Roedy Green
    Nov 2, 2005
  3. Sebastian Fey
    Replies:
    0
    Views:
    1,097
    Sebastian Fey
    Jun 27, 2003
  4. Antonio Amato
    Replies:
    2
    Views:
    1,256
    Michael Wiedmann
    Nov 18, 2004
  5. Replies:
    1
    Views:
    512
    Joseph Kesselman
    Nov 27, 2007
Loading...

Share This Page