我有以下文件树
mainfolder
|-assembly.xml
|
|-chapters
| |-introduction.xml
|
|-source
|-example01
|-main.cpp
assembly.xml
是我的文档的汇编文件。它包含对 的引用introduction.xml
。
这是组装:
<?xml version="1.0" encoding="UTF-8"?>
<assembly version="5.1"
xmlns="http://docbook.org/ns/docbook">
<resources xml:base="chapters/">
<resource href="introduction.xml" xml:id="introduction" />
</resources>
<structure xml:id="main-book">
<info>
<description>Book chapters</description>
</info>
<output renderas="book"/>
<module resourceref="introduction"/>
</structure>
</assembly>
introduction.xml
是 docbook chapter
。我想在其中插入一个示例,包括main.cpp
.
<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.1"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>Introduction</title>
</info>
<section>
<info>
<title>Chapter title</title>
</info>
<para>
You can see an example:
</para>
<example>
<title>main example</title>
<programlisting language="c++">
<xi:include href="./../source/example01/maiin.cpp" parse="text" />
</programlisting>
</example>
</section>
</chapter>
无论如何,当我编写这本书时(我使用的是 XMLMind 的个人版),我什么也没看到。在 PDF 中打印了示例,但main.cpp
我看到的不是源代码
<xi:include></xi:include>
我做错了什么?如何包含文件中的源代码?