Something simple that can be used in any version of XSLT:
<xsl:variable name="vApos">'</xsl:variable>
I am frequently using the same technique for specifying a quote:
<xsl:variable name="vQ">"</xsl:variable>
Then you can intersperse any of these variables into any text using the standard XPath function concat()
:
concat('This movie is named ', $vQ, 'Father', $vApos, 's secrets', $vQ)
So, this transformation:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name="vApos">'</xsl:variable>
<xsl:variable name="vQ">"</xsl:variable>
<xsl:template match="/">
<xsl:value-of select=
"concat('This movie is named ', $vQ, 'Father', $vApos, 's secrets', $vQ)
"/>
</xsl:template>
</xsl:stylesheet>
produces:
This movie is named "Father's secrets"