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] A simple HowTo for customizing the pdf-output of anDocBook xml






Hello Bob an everyone else,

I tried what you told me to do, but still its not working. May be that I
have some other problems.
So I describe what I'am doing:

1. I installed DocBook on my W2K Server in the Directory
c:\DocBook\docbook-xsl-1.61.3\

2. I wrote an customization Layer with following Contend (the template name
"header.content" included) placed in the same directory

<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
      xmlns="http.//www.w3.org/TR/xhtml1/transitional"
      xmlns:fo="http://www.w3.org/1999/XSL/Format";
      exclude-result-prefixes="#default">

<!-- Das eigentliche XSL-File, welches durch nachfolgende Parameter
modifiziert wird -->
<xsl:import href="fo/docbook.xsl"/>
<xsl:param name="use.extension" select="1"/>
<xsl:param name="fop.extensions" select="1"/>

<xsl:param name="paper.type" select="'A4'"/>

<!-- Nummeriert Sectionen automatisch -->
<xsl:param name="section.autolabel" select="1"/>
      <!-- Schreibt vor die Sectionsnummer die aktuelle Chapternummer -->
<xsl:param name="section.label.includes.component.label" select="1"/>

<!-- Fuegt Hinweisen Grafik-Symbole hinzu -->
<xsl:param name="admon.graphics" select="1"/>

<xsl:template name="header.content">
  <xsl:param name="pageclass" select="''"/>
  <xsl:param name="sequence" select="''"/>
  <xsl:param name="position" select="''"/>
  <xsl:param name="gentext-key" select="''"/>

<!--
  <fo:block>
    <xsl:value-of select="$pageclass"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$sequence"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$position"/>
    <xsl:text>, </xsl:text>
    <xsl:value-of select="$gentext-key"/>
  </fo:block>
-->

  <fo:block>

    <!-- sequence can be odd, even, first, blank -->
    <!-- position can be left, center, right -->
    <xsl:choose>
      <xsl:when test="$sequence = 'blank'">
        <!-- nothing -->
      </xsl:when>

      <xsl:when test="$position='left'">
        <!-- Same for odd, even, empty, and blank sequences -->
        <xsl:call-template name="draft.text"/>
      </xsl:when>

      <xsl:when test="($sequence='odd' or $sequence='even') and
$position='center'">
        <xsl:if test="$pageclass != 'titlepage'">
          <xsl:choose>
            <xsl:when test="ancestor::book and ($double.sided != 0)">
              <fo:retrieve-marker retrieve-class-name="section.head.marker"

retrieve-position="first-including-carryover"
                                  retrieve-boundary="page-sequence"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="." mode="titleabbrev.markup"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </xsl:when>

      <xsl:when test="$position='center'">
        <!-- nothing for empty and blank sequences -->
            <fo:external-graphic src="images/ABB-logo.gif"/>
      </xsl:when>

      <xsl:when test="$position='right'">
        <!-- Same for odd, even, empty, and blank sequences -->
        <xsl:call-template name="draft.text"/>
      </xsl:when>

      <xsl:when test="$sequence = 'first'">
        <!-- nothing for first pages -->
      </xsl:when>

      <xsl:when test="$sequence = 'blank'">
        <!-- nothing for blank pages -->
      </xsl:when>
    </xsl:choose>
  </fo:block>
</xsl:template>

</xsl:stylesheet>


3. I change to my wwwroot directory, where my docbook xml is, containing a
set, with two book. I run there first Xalan with the following call:

java -Dhttp.proxyHost=*.*.*.* -Dhttp.proxyPort=80 -DproxySet=True
org.apache.xalan.xslt.Process -in Book.xml -xsl
C:\DocBook\docbook-xsl-1.61.3\ABB_DocbookPdf.xsl -out Book.fo

I get lot's of errors (I show you only a few):

[Error] autoidx.xsl:18:31: Element type "xsl:stylesheet" must be declared.
[Error] autoidx.xsl:35:79: Element type "xsl:key" must be declared.
[Error] autoidx.xsl:39:27: Element type "xsl:key" must be declared.
...
[Error] synop.xsl:8:31: Element type "xsl:stylesheet" must be declared.
[Error] synop.xsl:26:35: Element type "xsl:template" must be declared.
[Error] synop.xsl:27:13: Element type "fo:block" must be declared.
[Error] synop.xsl:28:27: Element type "xsl:apply-templates" must be
declared.
...
file:///c:/DocBook/docbook-xsl-1.61.3/fo/docbook.xsl; Zeile #184; Spalte
#16; Making portrait pages on A4 paper (210mmx297mm)
file:///c:/DocBook/docbook-xsl-1.61.3/common/l10n.xsl; Zeile #176; Spalte
#20; No "de" localization of "hyphenation-character" exists; using "en".
file:///c:/DocBook/docbook-xsl-1.61.3/common/l10n.xsl; Zeile #176; Spalte
#20; No "de" localization of "hyphenation-push-character-count" exists;
using "en".
file:///c:/DocBook/docbook-xsl-1.61.3/common/l10n.xsl; Zeile #176; Spalte
#20; No "de" localization of "hyphenation-remain-character-count" exists;
using "en".
file:///c:/DocBook/docbook-xsl-1.61.3/common/l10n.xsl; Zeile #176; Spalte
#20; No "de" localization of "hyphenation-character" exists; using "en".

But afterwards I have an Book.fo File, which I process with FOP
I use therefor that call:

fop.bat Book.fo book.pdf     In the fop.bat I entered
LOCAL_FOP_HOME=C:\XSLT_Progs\fop-0.20.5rc3a\

I got a lot of INFO and Warnings and errors as well:

[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5rc3a
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[WARNING] Some static content could not fit in the area.
[INFO] [2]
[WARNING] Some static content could not fit in the area.
...
[ERROR] Couldn't find hyphenation pattern de
[ERROR] Error building hyphenation tree for language de
[ERROR] Couldn't find hyphenation pattern de
[ERROR] Error building hyphenation tree for language de
...
[WARNING] table-layout=auto is not supported, using fixed!
[WARNING] table-layout=auto is not supported, using fixed!
...
[INFO] area contents overflows area in line
[INFO] No spaces to justify text in line Sollwert_R³cklaufte
[INFO] No spaces to justify text in line Sollwert

After all that I get a PDF-File, which can be opened und looks pretty good
so far.

But I do not see my LOGO.

So something I'am still doing the wrong way.
Perhaps some of the error printouts can help to clear the problem I have.

With kind regards

Jochen



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