まず事前に
感謝をするのに役立ちます。
<userData>
<id>1234</id>
<firstName>John</firstName>
<lastName>Doe</lastName>
...
<balance>3526.35</balance>
<scripture>
<date>2017-02-20<date>
<label>Online payment to Amazon.com</label>
<amount>-92.25</amount>
</scripture>
<scripture>
<date>2017-01-27<date>
<label>Salary</label>
<amount>12000</label>
</scripture>
...
</userData>
次に、入力としてそのような構造をとるXSL-FOテンプレートを作成する必要があります。例:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="userData">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="only"
page-width="21cm" page-height="29.7cm"
margin-top="2.5cm" margin-bottom="1.5cm"
margin-left="4.5cm" margin-right="2.5cm">
<fo:region-body/>
<fo:region-after extent="1cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="only">
<fo:flow flow-name="xsl-region-body">
<fo:wrapper font-size="12pt"
font-family="Arial, Geneva, Helvetica, sans-serif">
<fo:block font-weight="bold" space-before="1.5cm">
ID: <xsl:value-of select="id/text()"/>
</fo:block>
<fo:block font-weight="bold">
User: <xsl:value-of select="lastName/text()"/>, <xsl:value-of select="firstName/text()"/>
</fo:block>
<fo:block font-weight="bold">
Balance: <xsl:value-of select="balance/text()"/>
</fo:block>
<fo:table table-layout="fixed"
space-before="1.5cm"
space-after="1.5cm">
<fo:table-column column-width="2cm"/>
<fo:table-column column-width="5.5cm"/>
<fo:table-column column-width="5cm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block font-weight="bold">
Date
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold">
Label
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold">
Amount
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="scripture">
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="date/text()"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="label/text()"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="amount/text()"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:wrapper>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
投稿の例と試したことを投稿してください。入力や期待される出力を表示せずに質問することもできません –