I use docbook to generate documents. The structure of the main document is modular using xinclude for the different modules.
My problem is about verbatim elements(elements with significant whitespaces) which are included into the main document via xinclude.
If I use a literallayout directly in the main document, the output is as expected: whitespaces are preserved.
I want to use an included file which contains a section with a literallayout element. If I generate a document with the included file the output gets stripped of its whitespaces.
Can anyone tell me how to keep the whitespaces in verbatim elements like literallayout or programlisting?
File1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<section id="someid">
<title>section title</title>
<para>
<literallayout>
This shall show a small picure with '0':
0
000
00000
</literallayout>
</para>
</section>
If I generate it as standalone document the output is as expected:
0
000
00000
If I use it as follows: File2.xml:
<?xml version="1.0" encoding="ISO-8859-15"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<book>
<bookinfo>
...minimum input here
</bookinfo>
<chapter id="First_Chapter">
<title>Introduction</title>
<section id="First_Section">
<title>literallayout and programlisting in the main xml file</title>
<para><literallayout>This should look like a triangle built out of the character '0'
0
000
00000
</para>
</section>
<xi:include href="File1.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
</book>
If I generate this document the first section will be as expected (as a pyramid)
but in the section which is included with xinclude all '0' are output on one line 0 000 00000.