<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
- <xsl:if test="$toc.section.depth > 0
- and $toc.max.depth > $depth.from.context
+ <xsl:if test="$toc.max.depth > $depth.from.context
and $nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-{$direction.align.start}">
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
- <xsl:if test="$toc.section.depth > 0
- and $toc.max.depth > $depth.from.context
+ <xsl:if test="$toc.max.depth > $depth.from.context
and $nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-{$direction.align.start}">
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
- <xsl:if test="$toc.section.depth > 0
- and $toc.max.depth > $depth.from.context
+ <xsl:if test="$toc.max.depth > $depth.from.context
and $nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-{$direction.align.start}">