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] EPUB3 default stylesheet throws NCX error


Hi Mike,
The solution is to switch to the namespaced version of the DocBook XSL distribution (docbook-xsl-ns-1.78.1) when processing DocBook 5 documents. When the non-namespaced stylesheets encounter a DocBook5 document in the namespace, it first tries to convert it to the namespace. It seems there is a bug in that process for epub3. In general, that conversion process presents other problems as well, so I would recommend downloading and using the *ns* version of the stylesheets.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

--------------------------------------------------
From: "Mike Cook" <m@mikecook.co.uk>
Sent: Tuesday, April 02, 2013 7:57 AM
To: <docbook-apps@lists.oasis-open.org>
Subject: [docbook-apps] EPUB3 default stylesheet throws NCX error

Hi List, I'm having an issue when running the default EPUB3 stylesheets on a document (see below for XML) as I'm getting an error with the generated NCX file.

(I'm running on OSX Lion and I've referenced the stylesheets directly for these examples)

$ xsltproc http://docbook.sourceforge.net/release/xsl/1.78.1/epub3/chunk.xsl test.xml
...
  Generating NCX file ...
  Request for title of element with no title: div (id="idp704")
  Request for title of element with no title: code (contained in )
  Writing OEBPS/toc.ncx for book

The NCX has an error in the title;
    <docTitle><text>My First Book???TITLE??????TITLE???</text></docTitle>

Also, the OPF has two extra itemref entries at the end of the <spine>.

If however I remove xmlns from the <book> node, it then works fine; <book version="5.0">

This solution is obviously wrong as the XML then fails validation;

$ xmllint --relaxng http://www.docbook.org/xml/5.0/rng/docbookxi.rng --noout test.xml

test.xml:2: element book: Relax-NG validity error : Expecting element set, got book test.xml:2: element book: Relax-NG validity error : Expecting a namespace for element book test.xml:2: element book: Relax-NG validity error : Did not expect element book there test.xml:2: element book: Relax-NG validity error : Expecting element section, got book test.xml:2: element book: Relax-NG validity error : Expecting element setindex, got book
  test.xml fails to validate


Perhaps it's related to my system - can I ask if anyone else gets the same errors?

I haven't done any XSLT programming in four years and I'm new to Docbook, so I want to make sure I have everything set up correctly before I start customising.


Many thanks,

Mike Cook



Example used;

<?xml version="1.0" encoding="utf-8"?>
<book xmlns="http://docbook.org/ns/docbook"; version="5.0">
  <info>
    <title>My First Book</title>
<author><personname><firstname>Jane</firstname><surname>Doe</surname></personname></author>
<copyright><year>2010</year><holder>Jane Doe</holder></copyright>
  </info>
  <chapter>
    <title>Chapter 1</title>
    <para>Paragraphs</para>
  </chapter>
</book>

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





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