![]() |
For each -> Seitenwechsel -> Name auf jeder neuen Seit
Hallo,
ich habe folgendes Problem. Bekomme folgendes XML.
XML-Code:
Nun muss ich es zum generieren eines PDF's verwenden. So eine Art Inhaltsverzeichnis usw.
<?xml version="1.0" encoding="ISO-8859-1"?>
<root> <Contents> <ProductGroup> <Name>PG X</Name> <Product> <Name>Produkt X</Name> </Product> <Product> <Name>Produkt X</Name> </Product> </ProductGroup> <ProductGroup> <Name>PG X</Name> <Product> <Name>Produkt X</Name> </Product> <Product> <Name>Produkt X</Name> </Product> </ProductGroup> </Contents> </root> Dort sollte aber der Produktgruppenname (/root/Contents/Productgroup/Name) auf jeder neuen Seite wieder angedruckt werden, falls es vorkommt, das sich beim Generieren die Seite wechselt. Habe meinen "primitiven" XSLT Code auch hier angehängt. Weiß jemand eine Lösung bzw. eine Hilfe? Danke im Vorraus!
XML-Code:
<xsl:for-each select="root/Contents/ProductGroup">
<fo:table table-layout="fixed" width="210mm" border-collapse="collapse" border-style="{$borderstyle}" border-width="0.5px" padding="0px"> <fo:table-column text-align="left" column-width="10mm" /> <fo:table-column text-align="left" column-width="190mm" /> <fo:table-column text-align="right" column-width="10mm" /> <fo:table-body> <fo:table-row> <fo:table-cell /> <fo:table-cell border-style="{$borderstyle}" border-width="0.5px" padding="0px"> <fo:block font-family="Arial" font-weight="bold" font-size="{$TableOfContentsProductGroupSize}"> <xsl:apply-templates select="Name" /> </fo:block> </fo:table-cell> <fo:table-cell /> </fo:table-row> <xsl:for-each select="Product"> <fo:table-row> <fo:table-cell number-columns-spanned="3" text-align="left" border-style="{$borderstyle}" border-width="0.5px" padding="0px"> <fo:block>*</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell /> <fo:table-cell number-columns-spanned="2" text-align="left" border-style="{$borderstyle}" border-width="0.5px" padding="0px"> <fo:block> <xsl:apply-templates select="Name" /> </fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> </fo:table-body> </fo:table> </xsl:for-each> |
Re: For each -> Seitenwechsel -> Name auf jeder neuen
Herzlich willkommen in der Delphi-PRAXiS, sirarcher.
Um einen running header mit formatting objects zu realisieren solltest du dich über die Verwendung von fo:marker informieren. Freundliche Grüße vom marabu |
Re: For each -> Seitenwechsel -> Name auf jeder neuen
Herzlichen DANK für den schnellen Tipp.
Genau das was ich gesucht habe. ![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:01 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz