2013-08-28 29 views

回答

1

这个问题有发现以下兄弟姐妹的症结仍然有当前DT作为其任期: XSLT: Select following-sibling until reaching a specified tag

然后,只需将整个表格定义为顶级DL模板即可:

<xsl:template match="dl"> 
    <fo:table> 
     <fo:table-body> 
      <xsl:for-each select="dt"> 
       <xsl:variable name="current-term" select="."/> 
       <fo:table-row> 
        <fo:table-cell font-weight="bold" width="5.5cm"> 
         <fo:block> 
          <xsl:apply-templates /> 
         </fo:block> 
        </fo:table-cell> 
        <fo:table-cell> 
         <fo:block> 
          <xsl:apply-templates select="following-sibling::dd[preceding-sibling::dt[1] = $current-term]" /> 
         </fo:block> 
        </fo:table-cell> 
       </fo:table-row> 
      </xsl:for-each> 
     </fo:table-body> 
    </fo:table> 
</xsl:template> 
<xsl:template match="dd"> 
    <fo:block> 
     <xsl:apply-templates /> 
    </fo:block> 
</xsl:template>