我使用docbook生成文档。主文档的结构是模块化的,对不同的模块使用xinclude。
我的问题是关于通过 xinclude 包含在主文档中的逐字元素(带有大量空格的元素)。
如果我直接在主文档中使用文字布局,则输出如预期:保留空格。
我想使用一个包含的文件,其中包含一个带有literallayout 元素的部分。如果我使用包含的文件生成一个文档,则输出中的空格会被删除。
谁能告诉我如何在文字布局或程序列表等逐字元素中保留空格?
文件1.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>
如果我将其生成为独立文档,则输出如预期:
0
000
00000
如果我按如下方式使用它: 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>
如果我生成此文档,第一部分将如预期的那样(作为金字塔)
但是在 xinclude 包含的部分中,所有“0”都在一行 0 000 00000 上输出。