[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl table

Subject: xsl table
From: Andreas Peter <info@xxxxxxxxxx>
Date: Wed, 13 Jun 2007 09:38:15 +0200
 xsl table
Hello together,

I managed my problem I posted a few days ago about table creation
using xml/xsl(fo). But now, there is a "new" one :-(

This is my xml file:

<table>
<tr><td>Di</td><td>12.06.07</td><td>15:00 - 16:30 Uhr</td><td>Kurs-Nr.:</td>
<td>1</td></tr>

<tr><td></td><td></td><td></td><td>Beitrag</td><td>4 Euro</td></tr>

<tr><td>Do</td><td>14.06.07</td><td>15:00 - 16:30 Uhr</td><td>Kurs-Nr.: </td>
<td>5</td></tr>

<tr><td>Fr</td><td>15.06.07</td><td>15:00 - 16:30 Uhr</td><td>Kurs-Nr.: </td>
<td>5</td></tr>

</table>

And this is my xsl file:

<xsl:template match="table">
 <fo:block xsl:use-attribute-sets="kursinfo">
 <fo:table table-layout="{$table.layout}" width="{$table.width}">
 <fo:table-body>
 <xsl:apply-templates select="tr" />
 </fo:table-body>
 </fo:table>
 </fo:block>
</xsl:template>

<xsl:template match="tr">
 <xsl:param name="pos_tr" select="position()" />
 <fo:table-row>
 <xsl:apply-templates select="td" />
 </fo:table-row>
</xsl:template>

<xsl:template match="td">
 <xsl:param name="pos_td" select="position()" />
 <fo:table-cell column-number="1" width="{$table.colwidth1}">
 <fo:block><xsl:value-of select="//tr[$pos_tr]/td[$pos_td]"/>
 </fo:block></fo:table-cell>
</xsl:template>

I want to use a variable for the <tr>-position as well as for the
<td>-position. How can I manage it to use the variable from <tr> when
I match <td>? If I want to parse the document an error occurs saying
"variable with name pos_tr could not be founded..."

Thanks a lot,
Andreas

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.