1

私はこのブックマップを持っています:

<?xml version="1.0" encoding="utf-8"?>
<bookmap>
<part>
    <chapter/>
    <chapter/>
    <chapter/>
</part>
<part/>
<part/>
<part/>
<part/>
<appendix/>
</bookmap>

テンプレート内に配置したいのですが、要素が か かどうかに依存する xsl:if コマンドpart/chapterですpart

processTopicTitleつまり、DITA-OT ディストリビューションの一部であるtemplate 内にこれらがありました。

<xsl:if test="bookmap/part/chapter">
    <fo:external-graphic src="thisischapter.png" />
</xsl:if>

<xsl:if test="bookmap/part">
    <fo:external-graphic src="thisispart.png" />
</xsl:if>

これは機能していません。

アイデアは、part/chaptersにのみ表示されるグラフィックと、 partのみに表示される別のグラフィックがあるということです。

4

2 に答える 2

0

私はそれを次のように機能させました:

<xsl:template name="insertDiamond">
    <xsl:variable name="topicref" select="key('map-id', ancestor-or-self::*[contains(@class,' topic/topic ')][1]/@id)"/>
    <xsl:choose>
        <xsl:when test="$topicref//ancestor-or-self::*[contains(@class, ' bookmap/part ')][not(child::*[contains(@class, ' bookmap/chapter ')])]">
            <!--Put actions here for parts without any chapters as childs-->
        </xsl:when>
        <xsl:otherwise>
            <!--Put actions here for the rest.-->
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
于 2016-04-08T05:03:09.627 に答える