引用xsl-fo中的元素

时间:2011-07-04 16:21:59

标签: xslt xsl-fo

是否有可能在xsl-fo中“引用”元素?我想要做的是以下几点:

<fo:marker marker-class-name="continued">
<!-- much much more xml text content -->
</fo:marker>

<--.....-->

<fo:table-body>
 <fo:table-row>
  <!--at his point I'd like to "reference" (or copy) the marker from above -->
 </fo:table-row>
 <!--many more rows which reference the same marker -->
</fo:table-body>

原因是如果我的表中有很多行且标记内容很大,那么xml就会变得太大。我已经尝试过xsl:copy-of元素,因为这看起来我正在尝试做的事情:

http://www.w3schools.com/xsl/el_copy-of.asp

但这不适用于我的fo,显然会忽略副本元素,因为我没有在输出中获得任何表头。有任何想法吗?我正在使用ecrion fo renderer。

由于

的Stefan

1 个答案:

答案 0 :(得分:0)

尝试使用fo:retrieve-marker

例如:

<fo:marker marker-class-name="continued">
<!-- much much more xml text content -->
</fo:marker>

<--.....-->

<fo:table-body>
 <fo:table-row>
  <fo:retrieve-marker retrieve-class-name="continued" retrieve-position="first-including-carryover"/>
 </fo:table-row>
 <!--many more rows which reference the same marker -->
</fo:table-body>