My XSLT stylesheet generates Bootstrap HTML where some elements may contain data-...
attributes to pass additional data to the framework. For example, I have this code to generate a popover element:
<xsl:template match="foo">
<a href="#" data-toggle="popover" data-placement="top" data-trigger="hover" data-html="true">
<xsl:attribute name="title">Popover Title</xsl:attribute>
<xsl:attribute name="data-content">This is some additional content.</xsl:attribute>
<xsl:text>Link</xsl:text>
</a>
</xsl:template>
The data-content
attribute is supposed to contain additional markup. The resulting output should be something like
<a href="#" ... data-content="This is <em>some</em> additional <a href='#'>content</a>.">Link</a>
How do I generate markup text for the <xsl:attribute>
in this case?
(Somewhat related: here and here and here.)
The answers
Thanks for the answers! While I think that kjhughes's answer provides the technically correct solution to implement properly what I need, I think that Ian's answer addresses my question more directly.