OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: titlepage troubles


Hi,

sorry if this message repeats along the same lines as various emails
posted here before, I have tried those and failed. Basically I have two
problems, firstly putting an image on the titlepage (that old one...) and
secondly generating a list of figures. Here are the various files in my
tests:

--- begin test.xml ---
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<article>
<articleinfo>
	<title>
	Test doc
	</title>
	<author>
		<firstname>Me</firstname>
		<surname>Me</surname>
	</author>
	<copyright>
		<year>2003</year>
	</copyright>
</articleinfo>

<sect1>
	<title>Introduction</title>

	<para>
	Stuff here <xref linkend="testfig"/>
	</para>
	<figure id="testfig">
		<title>Test Figure</title>
		<screen>
Hello
		</screen>
	</figure>
</sect1>

</article>
--- end test.xml ---

--- begin fo.xsl ---
<?xml version="1.0" encoding="utf-8"?>
<!-- XSL setup -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">
<xsl:import href="file:///tool/docbook/xsl/fo/docbook.xsl"/>
<xsl:include href="file:///tmp/title.xsl"/>

    <!-- fop extensions -->
    <xsl:param name="use.extensions" select="'1'"></xsl:param>
    <xsl:param name="fop.extensions" select="1"></xsl:param>

    <!-- page layout -->
    <xsl:param name="paper.type" select="'A4'"/>

    <!-- format the title page -->
<xsl:template match="corpauthor" mode="article.titlepage.recto.mode">
  <fo:external-graphic>
    <xsl:attribute name="src">logo.gif</xsl:attribute>
  </fo:external-graphic>
  <fo:inline color="blue">
    <xsl:apply-templates mode="titlepage.mode"/>
  </fo:inline>
</xsl:template>

    <!-- nice border around figures -->
    <xsl:attribute-set name="figure.properties" use-attribute-sets="formal.object.properties">
        <xsl:attribute name="border-color">#000000</xsl:attribute>
        <xsl:attribute name="border-style">solid</xsl:attribute>
        <xsl:attribute name="border-width">1px</xsl:attribute>
        <xsl:attribute name="padding">1em</xsl:attribute>
        <xsl:attribute name="background-color">#dddddd</xsl:attribute>
    </xsl:attribute-set>

    <!-- table of contents -->
    <xsl:param name="generate.section.toc.level" select="2"/>
    <xsl:param name="toc.section.depth" select="2"/>
    <xsl:attribute-set name="toc.margin.properties">
        <xsl:attribute name="break-after">page</xsl:attribute>
    </xsl:attribute-set>
<xsl:param name="generate.toc">
/article toc,figure
</xsl:param>

</xsl:stylesheet>
--- end fo.xsl ---

--- begin title.xml ---
<!DOCTYPE t:templates [
<!ENTITY hsize0 "10pt">
<!ENTITY hsize1 "12pt">
<!ENTITY hsize2 "14.4pt">
<!ENTITY hsize3 "17.28pt">
<!ENTITY hsize4 "20.736pt">
<!ENTITY hsize5 "24.8832pt">
<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 -->
<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 -->
<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 -->
<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 -->
<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 -->
<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 -->
]>

<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
         xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
             xmlns:fo="http://www.w3.org/1999/XSL/Format"
             xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<t:titlepage t:element="article" t:wrapper="fo:block"
             font-family="{$title.font.family}">

  <t:titlepage-content t:side="recto"
             text-align="center">

    <title t:named-template="component.title"
       param:node="ancestor-or-self::article[1]"
       keep-with-next="always"
       font-size="&hsize5;"
       font-weight="bold"
       color="#87A4C2"/>

    <subtitle/>
    <corpauthor space-before="0.5em"
                font-size="&hsize2;"/>
    <authorgroup space-before="0.5em"
                 font-size="&hsize2;"/>
    <author space-before="0.5em"
            font-size="&hsize2;"/>

    <othercredit space-before="0.5em"/>
    <releaseinfo space-before="0.5em"/>
    <copyright space-before="0.5em"/>
    <legalnotice text-align="start"
                 margin-left="0.5in"
                 margin-right="0.5in"
                 font-family="{$body.font.family}"/>
    <pubdate space-before="0.5em"/>
    <revision space-before="0.5em"/>
    <revhistory space-before="0.5em"/>
    <abstract space-before="0.5em"
          text-align="start"
          margin-left="0.5in"
              margin-right="0.5in"
              font-family="{$body.font.family}"/>
  </t:titlepage-content>

  <t:titlepage-content t:side="verso">
  </t:titlepage-content>

  <t:titlepage-separator>
  </t:titlepage-separator>

  <t:titlepage-before t:side="recto">
  </t:titlepage-before>

  <t:titlepage-before t:side="verso">
  </t:titlepage-before>
</t:titlepage>
</t:templates>
--- end title.xml ---

I changed the title.xml to title.xsl with:
prompt$ xsltproc /tool/docbook/xsl/template/titlepage.xsl title.xml > \
title.xsl

I generated the fo output using xsltproc:

prompt$ xsltproc fo.xsl test.xml > test.fo
Making portrait pages on A4 paper (210mmx297mm)

prompt$ xsltproc -V
Using libxml 20504, libxslt 10027 and libexslt 718
xsltproc was compiled against libxml 20504, libxslt 10027 and libexslt 718
libxslt 10027 was compiled against libxml 20504
libexslt 718 was compiled against libxml 20504


and then used fop (0.20.5):
promtp$ fop -fo test.fo -pdf test.pdf
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[INFO] [2]
[INFO] Parsing of document complete, stopping renderer

docbook info:
docbook-xml-4.2 with docbook-xsl-1.61.3

The file logo.gif exists and is readable. I tried several variations for
the src attribute including /tmp/logo.gif file:/tmp/logo.gif and others,
none of which worked. The list of figures is also not shown. Is anyone able
to offer an insight? Thanks in advance,

Tim



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