Monday 21 December 2009
>
> I'm upgrading a 4.5 Docbook document to 5.0 using db-upgrade.xsl and
> I'm getting an error on a rather simple document. Here it comes ..
>
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> <!DOCTYPE article
> PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
> <article lang=3D"">
> <sect1>
> <title>Hello, ..</title>
> <para>world</para>
> </sect1>
> </article>
>
> This document is valid according to a) Emacs/nxml and b) MSV.
I validated your document in oXygen and I can confirm it is valid. According
to the content model of article[1], a title is _optional_.
> Then I upgraded this document with db4-upgrade.xsl (Release: $Id:
> db4-upgrade.xsl 7660 2008-02-06 13:48:36Z nwalsh $) and I get:
>
> <!-- Converted by db4-upgrade version 1.0 -->
>
> <article xmlns=3D"http://docbook.org/ns/docbook" version=3D"5.0"
> xml:lang=""> <section><info><title>Hello, ..</title></info>
>
> <para>world</para>
> </section>
> </article>
>
> which is !!! NOT !!! valid ( inserting a article/title element makes it
> valid).
When I validate your file in oXygen, I get:
element "section" not allowed yet; expected element "info", "subtitle",
"title" or "titleabbrev"
So the best is to insert the missing title element right after article
_before_ applying the transformation.
According to the RELAX NG schema, an article[2] needs a title. The stylesheet
just doesn't know this case which creates an invalid DocBook 5 document. I
would consider it a bug.
>Is this bug known?
Look at [3], maybe there is already one.
>Is there a bug tracker?
See [3] on Sourceforge.
>Patches accepted?
Probably yes. :)
Tom
----------
[1] http://www.docbook.org/tdg/en/html/article.html
[2] http://www.docbook.org/tdg5/en/html/article.html
[3] http://sourceforge.net/tracker/?group_id=21935&atid=373747