2015-06-22 32 views
2

我需要为我的xsl:FO在表改造的<fo:retrieve-marker>,但我不知道这是可能的,因为我用FOP处理器为我的转变。XSL:FO检索标记物无效孩子

如果我在我的表使用<fo:retrieve-marker>我总是得到该标签必须是在静态内容的错误消息。

这里是与标记表

   <xsl:call-template name="MMEL-Table-Header"/> 

       <!-- Bottom table Line --> 
       <fo:table-footer> 
        <fo:table-row> 
         <fo:table-cell>                    
          <fo:marker marker-class-name="footer-continued"> <fo:inline>(continued)</fo:inline></fo:marker> 
         </fo:table-cell> 
        </fo:table-row> 

       </fo:table-footer> 

       <fo:table-body >    

        <xsl:variable name="identification"> 
         <xsl:value-of select="ident/message"/>         
        </xsl:variable>      
        <xsl:apply-templates select="ident"><xsl:with-param name="ident" select="$identification"/></xsl:apply-templates> 
        <xsl:apply-templates select="provisos/proviso"><xsl:with-param name="ident" select="$identification"/></xsl:apply-templates> 

       <fo:table-row> 
        <fo:table-cell> <fo:retrieve-marker retrieve-position="first-starting-within-page" retrieve-class-name="footer-continued" retrieve-boundary="document" /> </fo:table-cell> 
       </fo:table-row> 
       </fo:table-body>   
      </fo:table>   
+0

你能为我们提供SNI使用''查看你正在使用的代码。但基本上,'retrieve-marker'只能用于页眉或页脚('')。 – potame

+0

好 如果我把标志页脚中我没有得到任何错误消息,但这个是需要的问题,要在表格中显示我的文字 – bvb1909

+0

当然,这将出现在页脚的...那我建议一种解决方法可能是设置*(待续)*文本的负顶部边距,使其在页面中显示更高。但是除非你使用支持'retrieve-table-marker'的Antenna House或RenderX这样的商业产品,恐怕你别无选择。 – potame

回答

4

(披露:我是一个FOP开发商)

这个例子有动态表头和页脚表,所以它应该包括你的要求:

  • 如果表中的单个页面适合,既表头和页脚表是空
  • 如果表拆分成几个页面
    • 表头是空的第一页,并在下面的人它说:“(续)”
    • 表页脚是空的最后页面,并且在以前的它说:“(继续下页)”
  • 测试与FOP 2.0(旧版本没有支持表标记);由于FOP的当前限制,不间断空格&#x00A0;在表头和表尾是一个必要的“占位符”(页眉/页脚的尺寸被计算只是一次,不标记内容)
  • 没有具体的格式化器的扩展,所以这可能是与其他格式化工作过(XslFormatter支持表标记; XEP具有替代性的解决方法)

FO片段:

<fo:table table-layout="fixed" width="100%"> 
    <fo:table-column column-width="100%"/> 
    <fo:table-header> 
     <fo:table-row> 
     <fo:table-cell> 
      <fo:block> 
      <fo:retrieve-table-marker retrieve-class-name="mc1" 
       retrieve-position-within-table="first-starting" 
       retrieve-boundary-within-table="table-fragment"/> 
      &#x00A0; 
      </fo:block> 
     </fo:table-cell> 
     </fo:table-row> 
    </fo:table-header> 
    <fo:table-footer> 
     <fo:table-row> 
     <fo:table-cell> 
      <fo:block> 
      <fo:retrieve-table-marker retrieve-class-name="mc2" 
       retrieve-position-within-table="last-ending" 
       retrieve-boundary-within-table="table-fragment"/> 
      &#x00A0; 
      </fo:block> 
     </fo:table-cell> 
     </fo:table-row> 
    </fo:table-footer> 
    <fo:table-body> 
     <!-- first row --> 
     <fo:table-row> 
     <fo:table-cell> 
      <fo:block> 
      <fo:marker marker-class-name="mc1"></fo:marker> 
      <fo:marker marker-class-name="mc2">(continues on the next page)</fo:marker> 
      cell1 
      </fo:block> 
     </fo:table-cell> 
     </fo:table-row> 
     <!-- middle row --> 
     <fo:table-row> 
     <fo:table-cell> 
      <fo:block> 
      <fo:marker marker-class-name="mc1">(continued)</fo:marker> 
      <fo:marker marker-class-name="mc2">(continues on the next page)</fo:marker> 
      cell2 
      </fo:block> 
     </fo:table-cell> 
     </fo:table-row> 
     <!-- ... other similar rows ... --> 
     <!-- last row --> 
     <fo:table-row> 
     <fo:table-cell> 
      <fo:block> 
      <fo:marker marker-class-name="mc1">(continued)</fo:marker> 
      <fo:marker marker-class-name="mc2"></fo:marker> 
      cell9 
      </fo:block> 
     </fo:table-cell> 
     </fo:table-row> 
    </fo:table-body> 
    </fo:table> 
+1

很好的例子。请注意,它不适用于RenderX XEP。截至目前,我们选择不支持检索表格标记。我们可能在未来,但已经能够在大多数人的所有实施方案中解决更好(更快)的解决方案。 –

+0

我已经注意到FOP中的这个特性:https://xmlgraphics.apache.org/fop/2.0/extensions.html#table-continue-label。它是否可用于FOP 1.1? – potame

+0

@potame否,'fox:继续标签'扩展名可追溯到旧版本,并且在FOP 1.1和2.0中不可用:[源代码,请参见上一个要点](https://xmlgraphics.apache.org/fop /2.0/upgrading.html#pre-1.0)_(说实话,即使使用FOP 0.20.5,我也会遇到错误,但也许我只是在错误的位置使用它)_ – lfurini