OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: [docbook] Re: How to Xinclude an Introduction in a chapter (ie, no <section>)?


Hi Jeffrey,
The errors are about including simplesect in an inappropriate location. The DTD does not permit mixing simplesect and sections as siblings.

As you found, your introduction modular file has to have a root element to contain all of its content in order for it to be parsed as an XML document, but you don't want to include that root element. I can see two solutions:

1. Make the introduction a system entity reference instead of an Xinclude. A system entity file does not need to have a root element, so it could contain your sequence of paras and such.

2. Since you are using xsltproc, you can use the extended xpointer syntax that it supports. That can select all the children of the root element, but not the root element. Something like:

<xi:include href="test-intro.xml" xpointer="xpointer(/simplesect/*)" xmlns:xi="http://www.w3.org/2001/XInclude"/>

This reference has some more details about the latter method:

http://www.sagehill.net/docbookxsl/ModularDoc.html#XincludeSelect

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- From: "Jeffrey Walton" <noloader@gmail.com>
To: <docbook@lists.oasis-open.org>
Sent: Saturday, January 28, 2012 7:28 PM
Subject: [docbook] Re: How to Xinclude an Introduction in a chapter (ie, no <section>)?


My Bad -

I should have mentioned the errors I am getting. Below ch03.xml is the
chapter, and ch03a.xml is the introduction. ch03b.xml, ... ch03e.xml
wraps everything in a customary <section></section> and validates
fine.

$ xsltproc -V
Using libxml 20706, libxslt 10126 and libexslt 815
xsltproc was compiled against libxml 20706, libxslt 10126 and libexslt 815
libxslt 10126 was compiled against libxml 20706
libexslt 815 was compiled against libxml 20706
$ uname -a
Linux studio 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:12:07 UTC
2012 x86_64 GNU/Linux

Jeff

$ ./make-book.sh ch03.xml:4: element chapter: validity error : Element
chapter content does not follow the DTD, expecting (beginpage? ,
chapterinfo? , (title , subtitle? , titleabbrev?) , (toc | lot | index
| glossary | bibliography)* , tocchap? , (((calloutlist | glosslist |
bibliolist | itemizedlist | orderedlist | segmentedlist | simplelist |
variablelist | caution | important | note | tip | warning |
literallayout | programlisting | programlistingco | screen | screenco
| screenshot | synopsis | cmdsynopsis | funcsynopsis | classsynopsis |
fieldsynopsis | constructorsynopsis | destructorsynopsis |
methodsynopsis | formalpara | para | simpara | address | blockquote |
graphic | graphicco | mediaobject | mediaobjectco | informalequation |
informalexample | informalfigure | informaltable | equation | example
| figure | table | msgset | procedure | sidebar | qandaset | task |
anchor | bridgehead | remark | highlights | abstract | authorblurb |
epigraph | indexterm | beginpage)+ , (sect1* | refentry* | simplesect*
| section*)) | sect1+ | refentry+ | simplesect+ | section+) , (toc |
lot | index | glossary | bibliography)*), got (title simplesect
section section section section )
ch03a.xml:4: element simplesect: validity error : Element simplesect
content does not follow the DTD, expecting ((title , subtitle? ,
titleabbrev?) , (calloutlist | glosslist | bibliolist | itemizedlist |
orderedlist | segmentedlist | simplelist | variablelist | caution |
important | note | tip | warning | literallayout | programlisting |
programlistingco | screen | screenco | screenshot | synopsis |
cmdsynopsis | funcsynopsis | classsynopsis | fieldsynopsis |
constructorsynopsis | destructorsynopsis | methodsynopsis | formalpara
| para | simpara | address | blockquote | graphic | graphicco |
mediaobject | mediaobjectco | informalequation | informalexample |
informalfigure | informaltable | equation | example | figure | table |
msgset | procedure | sidebar | qandaset | task | anchor | bridgehead |
remark | highlights | abstract | authorblurb | epigraph | indexterm |
beginpage)+), got (simplesect para para para indexterm indexterm note
)
ch03a.xml:5: element simplesect: validity error : Element simplesect
content does not follow the DTD, expecting ((title , subtitle? ,
titleabbrev?) , (calloutlist | glosslist | bibliolist | itemizedlist |
orderedlist | segmentedlist | simplelist | variablelist | caution |
important | note | tip | warning | literallayout | programlisting |
programlistingco | screen | screenco | screenshot | synopsis |
cmdsynopsis | funcsynopsis | classsynopsis | fieldsynopsis |
constructorsynopsis | destructorsynopsis | methodsynopsis | formalpara
| para | simpara | address | blockquote | graphic | graphicco |
mediaobject | mediaobjectco | informalequation | informalexample |
informalfigure | informaltable | equation | example | figure | table |
msgset | procedure | sidebar | qandaset | task | anchor | bridgehead |
remark | highlights | abstract | authorblurb | epigraph | indexterm |
beginpage)+), got (indexterm indexterm indexterm indexterm indexterm )
Document book.xml does not validate

On Sat, Jan 28, 2012 at 9:54 PM, Jeffrey Walton <noloader@gmail.com> wrote:
Hi All,

I have a *really* long chapter. I thought I would break it down so
that the chapter had a bunch of xinclude's with the following
structure:

$ cat test.xml
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>

<book>
<chapter id="ch_test">
<title>Chapter Test</title>
<xi:include href="test-intro.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="test-section.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
....
</chapter>
</book>

$ cat test-intro.xml
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
<simplesect>
<indexterm>
<primary>Foo</primary>
</indexterm>

<para>Foo is mildly discussed in this introduction.</para>
</simplesect>

The problem I am having is: (1) the introduction is *not* a section -
it starts of with <indexterm> and then <para>; and (2) it won't
validate. I also tried wrapping the introduction in <simplesect>, but
no joy. I've attached a simple test case (xmllint-test.zip).

How does on xinclude free form text which is part of <para> (but has
no corresponding <section>)?

My apologies if the attachment is not appropriate.
http://www.docbook.org/guidelines did not appear to ban simple test
cases.

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





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