FO:内联容器什么都没显示

时间:2018-03-13 12:19:27

标签: xslt xslt-1.0 apache-fop

这是我的xsl:

的片段
UITableviewCell

<fo:table-row height="27.8mm"> <fo:table-cell border-bottom="0.2mm solid" number-columns-spanned="2"> <fo:table border="0px solid" border-collapse="collapse" table-layout="fixed" width="100%" height="100%"> <fo:table-column column-width="110mm"/> <fo:table-body> <fo:table-row height="27.8mm"> <fo:table-cell border-bottom="0.2mm solid" height="28mm"> <xsl:call-template name="LabelTemplate"> <xsl:with-param name="name" select="'REFERENCE'"/> </xsl:call-template> <xsl:call-template name="ReferenceTemplate"> <xsl:with-param name="First" select="First"/> <xsl:with-param name="Second" select="Second"/> <xsl:with-param name="eNo" select="eNo"/> </xsl:call-template> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:table-cell> </fo:table-row> 内使用内联容器时,不会显示任何内容。

ReferenceTemplate

使用此样本时,将显示内联容器内容。

<xsl:template name="ReferenceTemplate">
  <xsl:param name="First"/>
  <xsl:param name="Second"/>
  <xsl:param name="eNo"/>
  <xsl:param name="size" select="'22pt'"/>
  <xsl:param name="left" select="'5pt'"/>
  <xsl:param name="top" select="'15px'"/>
  <xsl:param name="text-indent" select="'5px'"/>
    <fo:block-container
            position="absolute"
            top="{$top}" left="{$left}" right="5pt"
            width="auto"
            border="0px solid"> 
     <fo:inline-container vertical-align="top" inline-progression-dimension="49.9%">
        <fo:block><xsl:value-of select="$Second"/></fo:block>
     </fo:inline-container>
     <fo:inline-container vertical-align="top" inline-progression-dimension="49.9%">
        <fo:block><xsl:value-of select="$First"/></fo:block>
     </fo:inline-container>
   </fo:block-container>
</xsl:template> 

1 个答案:

答案 0 :(得分:1)

我认为您无法将fo:inline-container嵌入fo:block-container

请参阅this reference for fo:block-container - fo:inline-container不在允许的孩子列表中。