问题描述
对于我正在写的书,我采用了 docbook 的方式。很多美好的事情,但是,经过大量的工作,我开始后悔了。我在渲染部分使用 XMLmind(使用 Bbedit 进行编辑)。 最后一滴是当我意识到在 docbook 文档中插入分页符没有简单的方法时。也就是说,除非您研究了所有 XSL 文档并尝试使用与 XMLmind 不同的样式表。
从 http://www.sagehill.net/docbookxsl/PageBreaking.html 我看到我应该放
<xsl:template match="processing-instruction('hard-pagebreak')">
<fo:block break-after='page'/>
</xsl:template>
某处,和
<?hard-pagebreak?>
我需要强制分页的地方。但重点是:这是 XMLmind 处理的 xml 文件的标题:
<book version="5.1" xml:lang="it" 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">
应该在哪里添加模板?
回答你的问题,原代码为:
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xml:lang="it" 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>This is a book</title>
</info>
<chapter xml:id="ch_intro">
<title>Introduction</title>
<section xml:id="first_section">
<title>The first section</title>
<para>Lorem ipsum dolor sit amet,consectetur adipiscing elit,sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam,quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</para>
</section>
<section xml:id="second_section">
<title>The second section</title>
<para>Lorem ipsum dolor sit amet,quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</para>
</section>
</chapter>
</book>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)