Modular documents

Figure 799. Motivating modular documents Slide presentation
Motivating modular documents

Figure 800. Monolithic document problems Slide presentation
  • Multiple author editing conflicts

  • User interface limits

  • No document component reuse


Figure 801. Document decomposition Slide presentation
Document decomposition

Figure 802. A monolithic document Slide presentation
<book version="5.2"
  xmlns="http://docbook.org/ns/docbook">
  <chapter version="5.2" xml:id="start">
    <title>Start</title>
    <para>See <xref linkend="intro" ❶/>.</para>
  </chapter>
  <chapter xml:id="intro" ❷>
    <title>Introduction</title>
    <para>Basic stuff.</para>
  </chapter>
</book>

An internal link.

Internal link target.


Figure 803. Decomposing documents Slide presentation

master.xml

<book version="5.2" ❶
  xmlns="http://docbook.org/ns/docbook"
  xmlns:xi="http://www.w3.org/2001/XInclude"> ❷
  <xi:include href="start.xml" ❸
     xpointer="element(/1)"/> ❹

  <xi:include href="intro.xml" ❺
     xpointer="element(/1)"/> ❻
</book>

start.xml

<chapter version="5.2" ❶
xmlns="http://docbook.org/ns/docbook">
  <title>Start</title>
  <para>See
     <xref linkend="intro"/>.</para>
</chapter>

intro.xml

<chapter version="5.2" ❶
xmlns="http://docbook.org/ns/docbook">
<title>Introduction</title>
  <para>Basic stuff.</para>
</chapter>

❶

Docbook namespace and version

❷

XInclude namespace

❸

Fist module filename reference

❹

component reference

❺

Second module filename reference

❻

component reference

exercise No. 4

Internal links and modular documents

Q:

Start from your internal link example document from your Internal document links exercise. Decompose this document into a master document and one document per <chapter>.

Is link consistency still being guaranteed? What about internal links spanning file boundaries?

Tip

Using the XMLMind editor there is a Tools --> Use as Master Document option being prerequisite when working with modular documents.