Modular documents

Figure 740. Motivating modular documents Slide presentation
Motivating modular documents

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

  • User interface limits

  • No document component reuse


Figure 742. Document decomposition Slide presentation
Document decomposition

Figure 743. A monolithic document Slide presentation
<book version="5.1"
  xmlns="http://docbook.org/ns/docbook">
  <chapter version="5.1" 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 744. Decomposing documents Slide presentation

master.xml

<book version="5.1" 
  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.1" 
xmlns="http://docbook.org/ns/docbook">
  <title>Start</title>
  <para>See
     <xref linkend="intro"/>.</para>
</chapter>

intro.xml

<chapter version="5.1" 
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.