I have the following input element:
<input type="radio">
<xsl:attribute name="name">
<xsl:value-of select="../../os:Row_ID "/>
</xsl:attribute>
<xsl:attribute name="row_id">
<xsl:value-of select="../../os:Row_ID "/>
</xsl:attribute>
<xsl:attribute name="column_id">
<xsl:value-of select="os:Column_ID "/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="../../os:Row_ID "/>
<xsl:value-of select="os:Column_ID "/>
</xsl:attribute>
</input>
Instead of using custom attributes, which dont get validated in the W3C validator, i want to use jQuerys data() method on:
<xsl:attribute name="row_id">
<xsl:value-of select="../../os:Row_ID "/>
</xsl:attribute>
<xsl:attribute name="column_id">
<xsl:value-of select="os:Column_ID "/>
So i can add “row_id” as the key, and the value of <xsl:value-of select="../../os:Row_ID "/> as the value.
How would i accomplish this, inside XSLT?
Note that using
<xsl:attribute>is superfluous unless you have variable attribute names. You can use attribute value templates (the{expressions in braces}) to assign values.