我有一个输出 XSL-FO 的 XSLT 样式表,用于生成 PDF 文件。我正在返回本周的预订,并希望在 PDF 文件中打印按工作日分组的预订。除了预订所属的工作日外,一切正常。
为了说明我的问题,我对生成的 PDF 文件进行了截图:
正如您在图片中看到的,前三个预订属于 25.Dezember.2012。如果我xsl:for-each
在我发布的代码中添加了like,那么每个预订都会显示工作日。
如果我将xsl:for-each
表体中的所有预订,无论预订属于 26.dezember 还是 27. dezember,都分配到 25.dezember。我不知道我做错了什么。如何正确打印带有预订的工作日?
<xsl:template match="/">
<fo:root>
<!-- defines the layout master -->
<fo:layout-master-set>
<fo:simple-page-master master-name="first"
page-height="29.7cm"
page-width="21cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2cm"
margin-right="2cm">
<fo:region-body margin-top="3cm" margin-bottom="1.5cm"/>
<fo:region-before region-name="kopf" extent="3cm"/>
<fo:region-after region-name="fuss" extent="1.5cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="quer"
page-width="29.7cm"
page-height="21cm"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2cm"
margin-right="2cm">
<fo:region-body margin-top="1cm" margin-bottom="1.5cm" />
<fo:region-before region-name="kopf" extent="1cm"/>
<fo:region-after region-name="fuss" extent="0.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<!-- starts actual layout -->
<fo:page-sequence master-reference="quer">
<fo:static-content flow-name="kopf">
<fo:block font-weight="bold" text-align="center" font-family="Arial" font-size="18pt">
<xsl:text>Test</xsl:text>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="fuss">
<fo:block border-bottom-width="thin" border-bottom-style="solid"
border-bottom-color="black" font-weight="bold" text-align="right" font-family="Arial" font-size="9pt">
erstellt am:
<xsl:value-of select="lfsExtension:FormatDateTime(.//Erstellt, 'dd.MM.yy HH:mm')"/>
<xsl:text> Seite: </xsl:text><fo:page-number/>/<fo:page-number-citation ref-id="lastBlock"/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<!--this defines a title level 1 -->
<xsl:for-each select=".//WeeklyBPlan" >
<fo:block
line-height="24pt"
space-after.optimum="15pt"
padding-top="3pt">
<xsl:value-of select=".//WEEKDAY" />
</fo:block>
<!-- table start -->
<fo:table table-layout="fixed" border="solid" border-collapse="collapse" border-width="0.5pt">
<fo:table-column column-width="25mm"/>
<fo:table-column column-width="12mm"/>
<fo:table-column column-width="20mm"/>
<fo:table-column column-width="50mm"/>
<fo:table-column column-width="20mm"/>
<fo:table-column column-width="25mm"/>
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Raum</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Zeit</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Abteilung</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Thema</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Mieter</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Tel.-Nr</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">PAnz</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Bestuhlung</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Bemerkung</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block background-color="grey"
color="white" text-align="center">Ausstattung</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid" padding-right="6pt" padding-left="6pt" >
<fo:block font-family="Arial" font-size="9pt" padding="2pt">
<xsl:value-of select=".//Raum" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" text-align="center">
<xsl:value-of select=".//Zeit" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" text-align="center">
<xsl:value-of select=".//Abteilung" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid" padding-left="6pt" padding-right="6pt">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" wrap-option="no-wrap" >
<xsl:value-of select=".//Thema" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" text-align="center">
<xsl:value-of select=".//Mieter" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" text-align="center">
<xsl:value-of select=".//Mieter_Tel" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" text-align="center">
<xsl:value-of select=".//Personen" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-right-width="0.5pt" border-right-style="solid" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt" text-align="center">
<xsl:value-of select=".//Bestuhlung" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding-left="8pt" border-right-style="solid" border-bottom-width="0.5pt" border-right-width="0.5pt" border-bottom-style="solid" >
<fo:block font-family="Arial" font-size="9pt" padding="2pt">
<xsl:value-of select=".//Bemerkung" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding-left="6pt" padding-right="6pt" border-bottom-width="0.5pt" border-bottom-style="solid">
<fo:block font-family="Arial" font-size="9pt" padding="2pt">
<xsl:value-of select=".//Ausstattung" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- table end -->
</xsl:for-each>
<fo:block id="lastBlock"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>