Help with custom stylesheets and titlepages

68 views
Skip to first unread message

Jason Pickering

unread,
Jan 22, 2010, 11:26:11 AM1/22/10
to docbkx-to...@googlegroups.com
I am attempting to create a custom title page for a book. I am using a
custom stylesheet , part of which looks like this..
....
<xsl:template name="book.titlepage.recto">
<fo:block>
<fo:table table-layout="fixed" width="175mm">
<fo:table-column column-width="175mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell text-align="center">
<fo:block padding-before="45mm">
<fo:external-graphic height="5cm"
scaling="uniform" src="file:./images/logo.jpg"/>
</fo:block>
<fo:block>
<xsl:value-of select="bookinfo/title" />
</fo:block>
<fo:block font-family="Helvetica" font-size="12pt">
<xsl:text>Version
</xsl:text><xsl:value-of select="bookinfo/releaseinfo"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
.....
There are two problems here. The title (although defined in the XML
source document) is not displayed in the PDF. Images are not found as
well.

Two questions, how do 1)I get the title to show up and 2) how do I
reference external images so they can be picked up during the
transformation?

Thanks and best regards,
Jason

Mimil Mimil

unread,
Jan 26, 2010, 3:14:27 AM1/26/10
to docbkx-to...@googlegroups.com
Hello,

sorry for the long delay reply, I hope my answers will help you a bit.

Concerning 1), are you using docbook v5 document (I mean namespaced xml). If yes you should have namespaced format of type <xsl:value-of select="d:bookinfo/d:title" />. But you are using namespaced document take care to use namespaced docbook stylesheets release to copy/past stylesheet snippets.

Concerning 2), what I did myself is asking maven to give me the fully qualified path.
In the stylesheet:

    <xsl:param name="stylesheet.src.path"/>
    
    <xsl:variable name="logo.small" select="concat($stylesheet.src.path,'images/small.png')"/>

In the pom.xml:

                    <customizationParameters>
                        <parameter>
                            <name>orange.stylesheet.src.path</name>
                            <value>file:///${project.build.directory}/generated-resources/stylesheets/</value>
                        </parameter>
                    </customizationParameters>

And where you need img:

                    <fo:external-graphic>
                        <xsl:attribute name="src">
                            <xsl:call-template name="fo-external-image">
                                <xsl:with-param name="filename" select="$logo.small"/>
                            </xsl:call-template>
                        </xsl:attribute>
                    </fo:external-graphic>

Regards,
Cédric,



--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To post to this group, send email to docbkx-to...@googlegroups.com.
To unsubscribe from this group, send email to docbkx-tools-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/docbkx-tools-users?hl=en.


Jason Pickering

unread,
Jan 26, 2010, 6:23:23 AM1/26/10
to docbkx-to...@googlegroups.com
Hi there. Thanks a million for this and the examples. I should be able
to figure it out with this.

Currently, I am using 4.4, as I believe this is what is supported by
the current version of docbkx in the maven repo.

Regards,
Jason

Mimil Mimil

unread,
Jan 26, 2010, 9:33:22 AM1/26/10
to docbkx-to...@googlegroups.com
If you are starting new documentations I suggest you to turn to docbook v5 (the current maintained version).
In terms of maven I am also the maintainer of docbook artifacts http://wiki.docbook.org/topic/Maven?highlight=(maven)

Concerning the namespaced docbook stylesheets (can be used for docbook v4.4 and docbook v5 documents), this is the one used in docbkx-tools (2.0.9+, I don't remember for 2.0.8). That is maybe why you have troubles with 1)

Concerning the docbook v5 xml schemas & catalogs, I haven't checked back if they are properly working in the current docbkx-tools (that s in the todo list) but at least the artifacts are published.


Regards,
Cédric,

Jason Pickering

unread,
Jan 26, 2010, 9:47:59 AM1/26/10
to docbkx-to...@googlegroups.com
Hi there. Thanks. One of the reasons we decided to go for 4.4 was the
editor we are using (Serna Free) supports 4.5. I actually had to
downgrade this to 4.4, as this seemed to be what is compatible with
the published artifact in the central maven repo.

This is from our pom..

<build>
<plugins>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<!-- <version>2.0.10-SNAPSHOT</version> -->
<artifactId>docbkx-maven-plugin</artifactId>
<configuration>
The full file is available
here..http://bazaar.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/files/pom.xml

I got 4.5 (but did not try 5.0) to work with the svn version (which I
commented out) I believe when I tried with 2.0.9, mvn told me that
the artifact was not available. This worked fine on my local repo,
but would not work on a system that did not have the SVN version
available locally.

Anyway, I think we will be forced to stick with 4.4/5 for now, until
we find another solution for a free editor, as not all of the people
contributing to the documentation effort are very comfortable using
something that is not WYSIWYG.

Thanks,
Jason

Mimil Mimil

unread,
Jan 26, 2010, 11:26:05 AM1/26/10
to docbkx-to...@googlegroups.com
did you had a look at XMLMindEditor http://www.xmlmind.com/xmleditor/license_perso.html, I think it is free for opensource softwares.

Regards,
Cédric,

Jason Pickering

unread,
Jan 26, 2010, 12:48:46 PM1/26/10
to docbkx-to...@googlegroups.com
Hi again.

Yes, we tried this one as well, but the problem is that is inserts a
lot unwanted white-space and it line wraps the XML. This makes
collaborative editing difficult, as most users are using Serna, some
are using Emacs or other editors. Making diffs of the edits is also
extremely difficult, without stripping out this whitespace, so this is
why we decided to go with Serna. If we need to move to 5.0, we may
need to find another solution.

Thanks anyway for the tip.

Regards,
Jason

Reply all
Reply to author
Forward
0 new messages