XML technologies / DocBook / Structural elements / Sections / Nested sections
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
DocBook provides two ways to nest sections:
sect1,sect2…sect5Nested
sectionelements
The following examples are structurally equivalent:
Example: Comparing nested sections using section and sect1 (section.xml)
<chapter>
<!-- ... -->
<section>
<title>Ein Abschnitt</title>
<para>Dies ist ein normaler Abschnitt.</para>
<section>
<title>Ein Unterabschnitt</title>
<para>Dies ist ein Unterabschnitt.</para>
</section>
</section>
</chapter><chapter>
<!-- ... -->
<sect1>
<title>Ein Abschnitt</title>
<para>Dies ist ein normaler Abschnitt.</para>
<sect2>
<title>Ein Unterabschnitt</title>
<para>Dies ist ein Unterabschnitt.</para>
</sect2>
</sect1>
</chapter>The two markup methods differ as follows:
The
sectionelement can be nested recursively, whereas thesectXelements stop at the fifth level.The nesting depth of
sectionis not limited by any DocBook schema. This can be an advantage or a disadvantage. A depth limit must be checked separately, using a Schematron rule or XSLT.By contrast,
sectXelements allow at most five nested levels. For deeper structures, customize a DocBook schema or usesection.Depending on the publishing system, excessive nesting of
sectioncan cause layout errors. This cannot happen withsectX.A section marked up with a
sectionelement can be moved to any position. This is not possible withsectXelements: their names encode their hierarchy levels, so they must be renamed.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top