Is it possible to have nested <xsl:for-each> loops within an xsl stylesheet?
I'm trying to get two rows of 12 buttons to appear on a web-page to simulate the F1 thru F24 and the ENTER button. I have the following code within my Stylesheet:
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="SUBMIT" name="NEEPFNAME" value="ENTR" /></td>
<xsl:for-each select='PFNEWLINE'>
</tr>
<tr>
<xsl:for-each select='PFKEY'>
<td>
<xsl:variable name="PFTYPE" select="PFTYPE" />
<xsl:variable name="PFVALUE" select="PFVALUE" />
<xsl:variable name="PFHEKEY" select="PFHEKEY" />
<xsl:variable name="PFNUM" select="PFNUM" />
<input type="{$PFTYPE}" name="NEEPFNAME" value="{$PFVALUE}" np=" KEY={$PFNUM} {$PFHEKEY} " >
<xsl:if test="PFDISABLED = 'DISABLED'">
<xsl:attribute name="DISABLED" />
</xsl:if>
</input>
</td>
</xsl:for-each>
</xsl:for-each>
</tr>
<tr>
<td></td>
</tr>
</table>
The XML I pass into this stylesheet is as follows:
<PFNEWLINE>
<PFKEY>
<PFTYPE>SUBMIT</PFTYPE>
<PFVALUE>Help</PFVALUE>
<PFHEKEY>hekey=T</PFHEKEY>
<PFDISABLED></PFDISABLED>
<PFNUM>PF1</PFNUM>
</PFKEY>
<PFKEY> [Repeated a total of 12 times]
</PFNEWLINE
[Above PFNEWLINE block repeated twice]
When I try to run my app to produce the web-page it falls over saying that there is something wrong near the </tr> tag of the PFNEWLINE for-each statement.
Can anyone help?




Reply With Quote