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

Cannot enter data into Dynamic Table cells

Subject: Cannot enter data into Dynamic Table cells
From: "Colin Mathieson" <colinmathieson@xxxxxxxxxxx>
Date: Thu, 01 Jul 2004 13:19:01 +0100
colin mathieson
I have looked through numerous mailing lists and forums but i am unable to find the solution i require, so hopefully there is someone who could help.

I am creating reports in HTML and RTF format from a flat file. This has been easily done, but I am also required to create a title page that lists unique references. I am able to get the unique references, but when i try to write them in my table, the incorrect field values are entered.

I am using an xml file to map the different elements required as follows:

<mappings root="RegistrationList" child="Registration" delimiter="">
	<mapping pos="0" length="4" name="title" type="Element" />
	<mapping pos="1" length="10" name="surname" type="Element" />
	<mapping pos="2" length="10" name="extsurname" type="Element" />
	<mapping pos="3" length="15" name="forename" type="Element" />
	<mapping pos="4" length="1" name="initial" type="Element" />
               <mapping pos="5" length="5" name="ref" type="Element" />
               <mapping pos="6" length="1" name="selind" type="Element" />
	<mapping pos="7" length="1" name="deadind" type="Element" />
	<mapping pos="8" length="1" name="tranind" type="Element" />
               <mapping pos="9" length="1" name="depind" type="Element" />
</mappings>


I am using the following code to get the unique references and trying to write them to a dynamic table. Instead of the references being entered, it writes the fields after i.e. values of selind,deadind,tranind,depind.


It does however put the correct amount of rows, and the correct reference value in the first cell of each row.

<xsl:key name="ref-key" match="ref" use="." />
<xsl:template match="/">
<xsl:variable name="unique-ref" select="/RegistrationList/Registration/ref[generate-id() = generate-id(key('ref-key', .))]" />
<table align="center" cellspacing="5" cellpadding="5">
<xsl:for-each select="$unique-ref[position() mod 5 = 1]">
<tr>
<td>
<xsl:value-of select="current()" />
</td>
<xsl:for-each select="current()[position()]/following::*[position() &lt; 5]">
<td>
<xsl:value-of select="current()" />
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</xsl:template>



the problem seems to be the line :


<xsl:for-each select="current()[position()]/following::*[position() &lt; 5]">

I have also used

<xsl:for-each select="current()[position()]/following::$unique-ref[position() &lt; 5]">

but it only produces a blank page.

Please someone help as this has been driving me crazy, and there is probably a simple solution.

Thanks in advance

Colin

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


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.