【问题标题】:FO:Inline container shows nothingFO:内联容器不显示任何内容
【发布时间】:2018-03-13 12:19:26
【问题描述】:

这是我的 xsl 的 sn-p:

<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> 

当使用此示例而不是显示内联容器内容时。

<fo:block text-align-last="justify">
  <xsl:value-of select="$Second"/>
  <fo:leader leader-pattern="space" />
  <xsl:value-of select="$First"/>
</fo:block>

【问题讨论】:

    标签: xslt xslt-1.0 apache-fop


    【解决方案1】:

    我认为您不能将 fo:inline-container 嵌入到 fo:block-container 中。

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

    【讨论】:

      猜你喜欢
      • 2019-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-29
      • 2020-11-10
      • 2012-04-12
      • 2019-11-11
      相关资源
      最近更新 更多