 |
 |
 |
I am using xsl to create reports in HTML and RTF from a textfile. I am using an xml mapping file in the following format.
<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="5" name="ref" type="Element" />
<mapping pos="5" length="1" name="selind" type="Element" />
<mapping pos="6" length="1" name="deadind" type="Element" />
<mapping pos="7" length="1" name="tranind" type="Element" />
<mapping pos="8" length="1" name="depind" type="Element" />
</mappings>
I have created the reports easily, but I have to create a title page, which includes listing the references in the report. I would like to display these in a dynamic table, as there will be an unknown quantity of references used.
I have tried to produce a 5 columned table as follows but to no avail. It correctly creates the required rows, but I am not able to enter the data into the cells after the first value of the row.
<<xsl:key name="ref-key" match="ref" use="." />
<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::node()[position() < 5]">
<td>
<xsl:value-of select="current()" />
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
The table is correctly created, but instead of the references being displayed, the value of the elements after that are displayed. i.e selind,deadind,tranind and depind.
I have tried substituting node() with $unique-ref and ref-key, but these do not appear to do anything.
I am new to using Xsl, therefore my knowledge is limited. I assumed when i created the variable unique-ref, that this would create another node-set which i could read the data from.
|
 | 



|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |