[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] table creation from xml
Hello xsl-list,
I want to create a table with 3 columns and x rows. The contents of the table should be read from a xml file which looks like the following example: <kursinfo> <referent>Vortrag mit Ekhard Woelbert</referent> <datum>Mi. 10.01.07</datum> <uhrzeit>19.30 - 21.00 Uhr</uhrzeit> <kursnr>Kurs-Nr: 1</kursnr> <beitrag>4,00 €</beitrag> <zusatz></zusatz> </kursinfo> <referent> should be spanned by 3 columns (managed :-). <datum> (should be always in first column), <uhrzeit> (should be always in second), <kursnr> AND <beitrag> always in third column among each other. This structure should be flexible so if elements of <datum>, <uhrzeit>, <kursnr>, <beitrag> will be added, the table should grow. IB4ve written a xsl file, but it does not really work so far: <xsl:template match="kursinfo"> <fo:block xsl:use-attribute-sets="kursinfo"> <fo:table width="{$table.width}" height="{$table.height}" table-layout="{$table.layout}"> <fo:table-body> <xsl:for-each select="referent"> <fo:table-row> <fo:table-cell number-columns-spanned="2" column-number="1"> <fo:block text-align="left"> <fo:inline font-weight="bold"> <xsl:value-of select="."/> </fo:inline> </fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> <xsl:for-each select="test"> <fo:table-row> <fo:table-cell column-number="1" width="20mm"> <fo:block text-align="left"><xsl:value-of select="datum"/></fo:block> </fo:table-cell> <fo:table-cell column-number="2" width="30mm"> <fo:block text-align="left"><xsl:value-of select="uhrzeit"/></fo:block> </fo:table-cell> <fo:table-cell column-number="3" width="20mm"> <fo:block text-align="left"><xsl:value-of select="kursnr"/></fo:block> <fo:block text-align="left"><xsl:value-of select="beitrag"/></fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> </fo:table-body> </fo:table> </fo:block> </xsl:template> I would be very thankful for any hint which will solve my "problem". Thanks a lot, Andreas
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|