I have this in an XSLT stylesheet sitting in a browser:
This all works fine but I need to have a "checked" attribute conditionally inserted before the closing tag based on xml sent from the server tagged as
The inserted attribute should be "checked" and not 'checked=""'. I've not worked with my XML stuff for a while and I just can't recall how to do this.
Code:
<xsl:variable name="name" select="@name" />
<xsl:variable name="input-type" select="@input" />
<xsl:value-of select="title" />
<xsl:for-each select="item">
<input type="{$input-type}"
name="{$name}" value="{@value}" />
<xsl:value-of select="."/>
</xsl:for-each>
Code:
<item value="stuff" checked="checked"></item>
Comment