[英]Table of Contents for Bible (with xsl-fo apache)
我需要一个以圣经书籍为导向的目录。 目前我每次都手动执行此操作,但从长远来看我会出错,这当然非常耗时。
它应该是这样的:
我已经读过一本关于它的书,但不幸的是没有进一步。
这是代码:
<xsl:template match="Kapitel">
<fo:block>
<xsl:apply-templates select="Titel" mode="Kap-Titel"/>
</fo:block>
<xsl:for-each selcet="Abschnitt">
<xsl:call-template name ="IVZ-Eintrag"/>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Kapitel/Titel"/>
<xsl:template name="IVZ-Eintrag">
<fo:block text-align-last="justify">
<xsl:apply-templates selcet="Titel" mode="IVZ-Titel"/>
<fo:leader/>
<fo:page-number-citation ref-id="{generate-id()}"/>
</fo:block>
</xsl:template>
<xsl:template match="Abschnitt">
<fo:block id="{generate-id()}">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
在这里您可以立即编辑它https://xsltfiddle.liberty-development.net/nb9PtDi/120
我认为应该沿着
<xsl:template match="BIBLEBOOK">
<fo:block keep-with-next.within-page="always" span="all" font-size="{$Schriftgroesse} * 1.4" line-height="{$Schriftgroesse} * 1.3" font-weight="bold" text-align="center" space-after="-1mm" space-before="1mm" space-after.precedence="1">
<xsl:apply-templates select="@bname"/>
</fo:block>
<!-- create the table of contents -->
<fo:block page-break-after="always">
<xsl:apply-templates select="CHAPTER" mode="toc"/>
</fo:block>
<!-- do the document -->
<fo:block font-family="{$Schriftname}" font-style="{$Schriftschnitt}" font-size="{$Schriftgroesse}" line-height="{$Zeilenhoehe}" page-break-inside="auto">
<xsl:apply-templates select="./CHAPTER"/>
</fo:block>
</xsl:template>
<xsl:template match="CHAPTER" mode="toc">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{generate-id(.)}">
<xsl:number level="single" count="CHAPTER"/>
<xsl:text> </xsl:text>
<fo:leader leader-length.minimum="12pt" leader-length.optimum="40pt"
leader-length.maximum="100%" leader-pattern="dots"/>
<xsl:text> </xsl:text>
<fo:page-number-citation ref-id="{generate-id(.)}"/>
</fo:basic-link>
</fo:block>
</xsl:template>
<xsl:template match="/XMLBIBLE/BIBLEBOOK/CHAPTER">
<fo:block id="{generate-id()}">...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.