Hopefully a quick question, how can I get this to be well formed, and therefore run?
<input type="rad" name="RadGroup" value="<xsl:value-of select="productOptionInfo"/>" />
I basically want to have a value placed inside of the attribute value, but they both need double quotes!?
Any ideas?
Many thanks
Double quotes, "" , and single quotes, '' , are valid entities in XML file when they are part of element value in XML.
Strings inside XML Tags are enclosed by a start tag and an end tag. So the content may have any combination of single and double quotes. The values of XML attributes are delimited by either single or double quotes.
The xsl:attribute element is used to add an attribute value to an xsl:element element or literal result element, or to an element created using xsl:copy. The attribute must be output immediately after the element, with no intervening character data. Available in XSLT 1.0 and later versions.
In XSLT, there is a shortcut to use values within attributes:
<input type="rad" name="RadGroup" value="{productOptionInfo}" />
There is another option, which it to use xsl:attribute
:
<input type="rad" name="RadGroup">
<xsl:attribute name="value">
<xsl:value-of select="productOptionInfo"/>
</xsl:attribute>
</input>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With