logo       

FO stylesheet problem #2: docbook xml book converts to invalid FO: msg#00038

Subject: FO stylesheet problem #2: docbook xml book converts to invalid FO
Hi all,

I've just attempted for the first time to produce pdf output from a docbook xml book (my previous efforts being with docbook xml _articles_).

Here is the basic document, without any refdb features:
........................................................................................
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd";>
<book>
   <bookinfo>
       <title>Test of Reference Name</title>
       <author>
           <surname>Nebauer</surname>
           <firstname>David</firstname>
       </author>
   </bookinfo>
   <chapter id="bogus">
       <title>Bogus Reference</title>
<para>Here's a reference to [... citation here ...] involve the refdb machinery.</para>
   </chapter>
</book>
........................................................................................

This document easily converts to a 5-page pdf document with saxon and fop.

If I now add the bibliography entity declaration, a citation and the bibliography entity itself, I get the following document:
........................................................................................
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"; [
<!ENTITY bibliography SYSTEM "bookref.bib.xml">
]>
<book>
   <bookinfo>
       <title>Test of Reference Name</title>
       <author>
           <surname>Nebauer</surname>
           <firstname>David</firstname>
       </author>
   </bookinfo>
   <chapter id="bogus">
       <title>Bogus Reference</title>
<para>Here's a reference to <citation role="REFDB">lamport1994</citation> to involve the refdb machinery.</para>
   </chapter>
   &bibliography;
</book>
........................................................................................

Using the refdbnd Makefile to convert to pdf produces a valid .bib file:
........................................................................................
<!-- <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE bibliography PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";> -->
<bibliography role="refdb">
<title>Reference List</title>
<bibliomixed id="IDlamport1994" role="BOOK">
<bibliomset role="intext" id="IDlamport1994X">(<bibliomset relation="author"><surname>Lamport</surname></bibliomset>, <pubdate role="primary">1994</pubdate>)</bibliomset> <bibliomset role="intextsq" id="IDlamport1994S">(<bibliomset relation="author"><surname>Lamport</surname></bibliomset>, <pubdate role="primary">1994</pubdate>)</bibliomset> <bibliomset role="authoronly" id="IDlamport1994A"><bibliomset relation="author"><surname>Lamport</surname></bibliomset></bibliomset> <bibliomset role="authoronlysq" id="IDlamport1994Q"><bibliomset relation="author"><surname>Lamport</surname></bibliomset></bibliomset> <bibliomset role="yearonly" id="IDlamport1994Y">(<pubdate role="primary">1994</pubdate>)</bibliomset> <bibliomset role="bibliography" id="IDlamport1994B"><bibliomset relation="book"><bibliomset relation="author"><surname>Lamport</surname> <firstname>L.</firstname></bibliomset>, </bibliomset><bibliomset relation="book"><pubdate role="primary">1994</pubdate>, </bibliomset><bibliomset relation="book"><title role="BOOK">LaTeX: A Document Preparation System</title> (</bibliomset><bibliomset relation="book"><publishername>Addison-Wesley</publishername>, </bibliomset><bibliomset relation="book"><address><city>Massachusetts</city></address>) </bibliomset></bibliomset></bibliomixed>
<bibliomixed role="multixref"></bibliomixed></bibliography>
........................................................................................

It produces an FO file, but that file is not valid. Neither passivetex, fop or xep would convert it to pdf. passivetex became terminally confused and produced gibberish. Here are the error messages for fop and xep:

FOP:
........................................................................................
[ERROR] file:/home/david/data/computing/docbook-xml/learn/bookref/bookref.fo:2:56273 master-reference '' for fo:page-sequence matches no simple-page-master or page-sequence-master
........................................................................................

XEP:
........................................................................................
(document [system-id file:/home/david/data/computing/docbook-xml/learn/bookref/bookref.fo]
 (validate
[error] file:/home/david/data/computing/docbook-xml/learn/bookref/bookref.fo: line 2: Attribute 'master-name' cannot occur at element 'fo:page-sequence'. [error] file:/home/david/data/computing/docbook-xml/learn/bookref/bookref.fo: line 2: Attribute 'master-reference' is required for 'fo:page-sequence'.
   [validation total: 2 errors]
Parse error: Invalid XSL FO source 'file:/home/david/data/computing/docbook-xml/learn/bookref/bookref.fo': 2 error(s) found during validation
.........................................................................................

Both of them are complaining about the same error: an illegal attribute ('master-name') in element 'fo:page-sequence'. xep also thinks a required attribute ('master-reference') is missing from the same element.

Here is the offending bit of the FO file. Look for the <fo:page-sequence id="id2562418" ...> element and see the master-name attribute. I have added some context to show that this element occurs in the FO file after the main text and before the reference list heading. You can also see the duplication of the text: "Reference List".
........................................................................................................
Here's a reference to <fo:basic-link internal-destination="IDlamport1994">(Lamport, 1994)</fo:basic-link> to involve the refdb machinery.</fo:block></fo:flow></fo:page-sequence><fo:page-sequence id="id2562418" hyphenate="true" master-name="back" language="en"> [... snip ...] <fo:block>Reference List</fo:block> [... snip ...]<fo:block>Reference List</fo:block> [... snip ...] <fo:block id="IDlamport1994" space-before.optimum="1em" space-before.minimum="0.8em" space-before.maximum="1.2em">Lamport L., 1994, LaTeX: A Document Preparation System (Addison-Wesley, Massachusetts) </fo:block>
........................................................................................................

This error occurs with both saxon-xerces and xsltproc, which would seem to rule out an xslt processor-specific bug.

Since the source file converts to html perfectly the problem appears to lie with the refdb fo stylesheets. Since docbook xml articles do not appear to produce the same error, it involves something specific to docbookx books -- or at least not affecting docbookx articles. Once again, however, I am insufficiently knowledgeable about xsl (and fo) to determine the cause of the problem.

Does anybody have an idea what is happening here? Has anyone ever produced a pdf file from a docbook xml book using refdb?

Regards,
David.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe