I am trying to design a form using xsl which parses a simple xml file; like this:
<tests>
<agent ID="1" Name="Name 1" />
<agent ID="2" Name="Name 2" />
<agent ID="3" Name="Name 3" />
</tests>
and xsl file:
<form action="." method="post" >
<xsl:for-each select="tests">
<table >
<tr>
<th></th>
<th>ID</th>
<th>Name</th>
</tr>
<xsl:for-each select="agent">
<tr>
<td><input type="checkbox" name="checkbox1" value="" /> </td>
<td><xsl:value-of select="@ID"/></td>
<td><xsl:value-of select="@Name"/></td>
</tr>
</xsl:for-each>
</table>
<input type="submit" value="Delete"/>
</xsl:for-each>
</form>
I want the value of checkbox to be the ID value.(<xsl:value-of select="@ID"/>). but I cannot use this tag inside checkbox tag.
What should I do?
<xsl:attribute>will allow you to add arbitrary attributes to tags.