代码之家  ›  专栏  ›  技术社区  ›  OOvic

使用fop的多页pdf每个人标签一页

  •  0
  • OOvic  · 技术社区  · 7 年前

    我需要使用xsl fo模板将xml数据转换为使用fop的pdf。 我的XML数据如下所示。

    <resultset>
    <person>
    </person>
    <person>
    </person>
    <person>
    </person>
    </resultset>
    

    每个person标签都需要进入pdf中的单独页面。可以 请有人用一个示例xsl fo模板来指导我。

    2 回复  |  直到 7 年前
        1
  •  2
  •   Tony Graham    7 年前

    两种备选方案:

        2
  •  1
  •   Hobbes    7 年前

    这将让你开始,具体取决于person标签中的信息。

    <xsl:template match="person">
        <fo:block page-break-before="always">
             process the contents of the person tag here
        </fo:block>
    </xsl:template>
    

    一些背景信息:
    XSLT
    XSL-FO
    XSL-FO 2