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] What is wrong in this title page spec?



I did not work... getting exception for duplicate id.

Surprisingly i did not get it earlier :(

~spr


Mininal Book
============
<?xml version='1.0'?>
<!DOCTYPE book [
<!ENTITY nbsp               " ">
]>

<book
    lang        = "en"
    xmlns       = "http://docbook.org/ns/docbook"; version="5.0"
    xmlns:xi    = "http://www.w3.org/2001/XInclude";
    xmlns:xsl   = "http://www.w3.org/1999/XSL/Transform";
    xmlns:xlink = "http://www.w3.org/1999/xlink";>

    <info>
      <title>Book Title</title>
      <releaseinfo>Release Info</releaseinfo>
      <legalnotice>
        <title>IMPORTANT NOTICE</title>
        <para>Legal para</para>
      </legalnotice>
    </info>

    <chapter id="test">
      <info>
        <title>Test Chapter</title>
      </info>
      <para>simple test para</para>
    </chapter>
</book>

Mininal XSL
===========

<xsl:stylesheet
  version     = "1.0"
  xmlns:d     = "http://docbook.org/ns/docbook";
  xmlns:xsl   = "http://www.w3.org/1999/XSL/Transform";
  xmlns:fo    = "http://www.w3.org/1999/XSL/Format";
  xmlns:l     = "http://docbook.sourceforge.net/xmlns/l10n/1.0";>

  <xsl:import
    href    = "../docbook-xsl-ns-1.73.2/fo/docbook.xsl" />

<!--
  Had to add these attributes to avoid this exception:

  SEVERE: Exception
  javax.xml.transform.TransformerException: attribute-set named
legalnotice.titlepage.recto.style does not exist
  -->
<xsl:attribute-set name="legalnotice.titlepage.recto.style"/>
<xsl:attribute-set name="legalnotice.titlepage.verso.style"/>


  <xsl:include
    href    = "./pdf/test-title.xsl" /> <!-- generated from spec below -->

  <xsl:param
    name    = "fop1.extensions"
    select  = "1" />

  <xsl:param
    name    = "draft.mode"
    select  = "no" />

  <xsl:param
    name    = "draft.watermark.image"
    select  = "images/draft.png" />

  <xsl:param
    name    = "double.sided"
    select  = "1" />


<xsl:template match="d:book">
  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

  <xsl:variable name="preamble"
               
select="d:title|d:subtitle|d:titleabbrev|d:bookinfo|d:info"/>

  <xsl:variable name="content"
                select="node()[not(self::d:title or self::d:subtitle
                            or self::d:titleabbrev
                            or self::d:info
                            or self::d:bookinfo)]"/>

  <xsl:variable name="titlepage-master-reference">
    <xsl:call-template name="select.pagemaster">
      <xsl:with-param name="pageclass" select="'titlepage'"/>
    </xsl:call-template>
  </xsl:variable>

  <xsl:call-template name="front.cover"/>


  <xsl:if test="$preamble">
    <xsl:call-template name="page.sequence">
      <xsl:with-param name="master-reference"
                      select="$titlepage-master-reference"/>
      <xsl:with-param name="content">
        <fo:block id="{$id}">
          <xsl:call-template name="book.titlepage"/>
        </fo:block>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:if>


<!--
  This section causes exception:

SEVERE: Exception
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Property id "N1000E" previously used;
id values must be unique in document.
-->
  <xsl:call-template name="page.sequence">
    <xsl:with-param name="master-reference"
                    select="$titlepage-master-reference"/>
    <xsl:with-param name="content">
      <fo:block id="ln-{$id}">
        <xsl:call-template name="legalnotice.titlepage"/>
      </fo:block>
    </xsl:with-param>
  </xsl:call-template>

  <xsl:apply-templates select="d:dedication" mode="dedication"/>

  <xsl:call-template name="make.book.tocs"/>

  <xsl:apply-templates select="$content"/>

  <xsl:call-template name="back.cover"/>

</xsl:template>

</xsl:stylesheet>

Spec for additional titlepage
=============================
<!DOCTYPE t:templates [
  <!ENTITY hsize0 "10pt">
]>

  <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="legalnotice"
        t:wrapper="fo:block">
      <t:titlepage-content t:side="recto">
        <legalnotice />
      </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>


Command-line executed
=====================

$ ./fop-0.94/fop -d -xml ./input/test/index.xml -xsl ./custom/test.xsl -pdf
./output/test/test.pdf
Oct 17, 2007 1:53:24 AM org.apache.fop.cli.InputHandler warning
WARNING: javax.xml.transform.TransformerException: Making portrait pages on
USletter paper (8.5inx11in)
Oct 17, 2007 1:53:28 AM org.apache.fop.hyphenation.Hyphenator
getHyphenationTree
SEVERE: Couldn't find hyphenation pattern en
Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler
endElement
WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. flow
(http://www.w3.org/1999/XSL/Format)
Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler
endElement
WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs.
page-sequence (http://www.w3.org/1999/XSL/Format)
Oct 17, 2007 1:53:28 AM org.apache.fop.fo.FOTreeBuilder$MainFOHandler
endElement
WARNING: Mismatch: block (http://www.w3.org/1999/XSL/Format) vs. root
(http://www.w3.org/1999/XSL/Format)
Oct 17, 2007 1:53:28 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Property id "N1000E" previously used;
id values must be unique in document.
        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:166)
        at org.apache.fop.cli.Main.main(Main.java:197)

---------

javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Property id "N1000E" previously used;
id values must be unique in document.


 

spr wrote:
> 
> Hi Bob!
> 
> 1) I was using:
>        t:element="legalnotice"
>     Due to failures, i tried adding name space "d:"
> 
> 2) I have modified the page sequence, and I can see 2 additional pages
> being generated.
>     But both are empty. (verso - expected, but recto - expected some
> content).
> 
>     Will try the exact contents in your mail & get back...
> 
> ~spr
> 

-- 
View this message in context: http://www.nabble.com/What-is-wrong-in-this-title-page-spec--tf4630333.html#a13242130
Sent from the docbook apps mailing list archive at Nabble.com.



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