0

I am experimenting with DocBook → FO→ PDF conversion (new to DocBook). fop fails on <linegroup> (on the MWE below) with:

"fo:list-item-label" is missing child elements. Required content model: marker* (%block;)+

The commands I run are these two (docbook-xml-ns 1.79.2 and fop 2.6-2, packaged for Debian stable):

xsltproc -o db0.fo /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/fo/docbook.xsl db0.xml
fop -pdf db0.pdf -fo db0.fo

And this is the db0.xml, minimal input for xsltproc.

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V5.2//EN" "http://www.oasis-open.org/docbook/xml/5.2/docbook.dtd">
<book xmlns="http://docbook.org/ns/docbook" version="5.2">
    <chapter>
        <linegroup>
            <line>Line 1</line>
            <line>Line 2</line>
        </linegroup>
    </chapter>
</book>

Could someone point me in the direction of fixing this?

I need the <linegroup> (or anything similar) to quote a fragment written in verse, and can't use <literallayout> as the lines contain markup (footnote, emphasis etc).

Rob
  • 14,746
  • 28
  • 47
  • 65
eudoxos
  • 18,545
  • 10
  • 61
  • 110
  • 1
    `linegroup` cannot be a direct child of `chapter`: https://tdg.docbook.org/tdg/publishers/5.2/linegroup.html. Note that `linegroup` is part of the "DocBook Publishers" schema, not core DocBook. – mzjn Feb 12 '23 at 09:17
  • Thanks for clarification. The source was passing xslt DocBook → XHTML conversion, so I thought it was correct. Could you please comment shortly how to include the DocBook Publishers schema in the document? Sorry, I am a numerics guy ;) – eudoxos Feb 12 '23 at 10:29
  • 1
    This is not easy to explain in a comment. You don't include the schema "in the document". RELAX NG itself has no mechanism for associating an XML document with a schema. There are tools that can validate RELAX NG, for example xmllint (https://gnome.pages.gitlab.gnome.org/libxml2/xmllint.html). See also https://relaxng.org/#validators (some links are likely obsolete). There is also a DTD (but it won't catch everything): https://docbook.org/xml/publishers/1.0/dtd/ – mzjn Feb 12 '23 at 11:10
  • 1
    You can find sample documents here; https://github.com/docbook/docbook/tree/main/src/publishers/samples – mzjn Feb 12 '23 at 11:16
  • Regardinng validation, see also https://tdg.docbook.org/tdg/5.2/ch03.html – mzjn Feb 12 '23 at 12:16
  • Experiment result: the `` element requires a `` inside, then it passes (even as a child of `chapter`). @mzjn examples were very useful, appreciated! – eudoxos Feb 13 '23 at 12:14

0 Answers0