</xsl:choose>
<xsl:apply-templates select="d:indexterm"/>
</fo:block>
+ <!-- include leading indexterms in glossdef to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="d:glossdef/d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
</xsl:template>
<xsl:template match="d:glossentry/d:glossdef" mode="glossary.as.list">
- <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
+ <xsl:apply-templates select="*[local-name(.) != 'glossseealso' and
+ not(self::d:indexterm[not(preceding-sibling::*)])]"/>
<xsl:if test="d:glossseealso">
<fo:block>
<xsl:variable name="template">
</xsl:with-param>
</xsl:call-template>
</fo:block>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates/>
+ <xsl:apply-templates select="*[not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</fo:block>
</fo:list-item-body>
</xsl:variable>
</xsl:choose>
</xsl:template>
+<!-- process any <indexterms> appearing before other elements in
+ listitem here to prevent empty block that triggers space-before
+ of the first para in the listitem -->
+<xsl:template match="d:indexterm" mode="leading.indexterms">
+ <xsl:apply-templates select="."/>
+</xsl:template>
+
<xsl:template name="itemizedlist.label.markup">
<xsl:param name="itemsymbol" select="'disc'"/>
<fo:block>
<xsl:apply-templates select="." mode="item-number"/>
</fo:block>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates/>
+ <xsl:apply-templates select="*[not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</fo:block>
</fo:list-item-body>
</xsl:variable>
<fo:block xsl:use-attribute-sets="variablelist.term.properties">
<xsl:apply-templates select="d:term"/>
</fo:block>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="d:listitem/d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates select="d:listitem"/>
+ <xsl:apply-templates select="d:listitem">
+ <xsl:with-param name="vl.as.list" select="1"/>
+ </xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</xsl:variable>
</xsl:template>
<xsl:template match="d:varlistentry/d:listitem">
- <xsl:apply-templates/>
+ <xsl:param name="vl.as.list" select="0"/>
+ <xsl:choose>
+ <xsl:when test="$vl.as.list != 0">
+ <xsl:apply-templates select="*[not(self::d:indexterm[not(preceding-sibling::*)])]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
</xsl:choose>
</xsl:variable>
- <fo:table id="{$id}" xsl:use-attribute-sets="simplelist.vertical.properties">
+ <fo:table id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
<xsl:choose>
<xsl:when test="$axf.extensions != 0 or $xep.extensions != 0">
</xsl:otherwise>
</xsl:choose>
</fo:block>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates/>
+ <xsl:apply-templates select="*[not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:block id="{$id}">
<xsl:text>•</xsl:text>
</fo:block>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates/>
+ <xsl:apply-templates select="*[not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<xsl:with-param name="arearefs" select="@arearefs"/>
</xsl:call-template>
</fo:block>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates/>
+ <xsl:apply-templates select="*[not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:block/>
</xsl:otherwise>
</xsl:choose>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<xsl:choose>
<xsl:when test="$deflabel = 'none' and not(d:label)">
<fo:block font-weight="bold">
- <xsl:apply-templates select="*[local-name(.)!='label']"/>
+ <xsl:apply-templates select="*[local-name(.)!='label' and
+ not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
- <xsl:apply-templates select="*[local-name(.)!='label']"/>
+ <xsl:apply-templates select="*[local-name(.)!='label' and
+ not(self::d:indexterm[not(preceding-sibling::*)])]"/>
</xsl:otherwise>
</xsl:choose>
<!-- Uncomment this line to get revhistory output in the question -->
</fo:block>
</xsl:when>
<xsl:otherwise>
- <fo:block/>
+ <fo:block> </fo:block>
</xsl:otherwise>
</xsl:choose>
+ <!-- include leading indexterms in this part to prevent
+ extra spacing above first para from its space-before -->
+ <xsl:apply-templates mode="leading.indexterms"
+ select="child::d:indexterm[not(preceding-sibling::*)]"/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
- <xsl:apply-templates select="*[local-name(.)!='label' and local-name(.) != 'qandaentry']"/>
+ <xsl:apply-templates select="*[local-name(.)!='label' and local-name(.) != 'qandaentry' and
+ not(self::d:indexterm[not(preceding-sibling::*)])]"/>
<!-- * handle nested answer/qandaentry instances -->
<!-- * (bug 1509043 from Daniel Leidert) -->
<xsl:if test="descendant::d:question">