I am using JavaScript something like this:
<script>
<xsl:for-each select = '/request/alldata'>
var l_allDataValue = '<xsl:value-of select="." />';
var l_dataArray = l_allDataValue.split('!~');
callFunction(l_dataArray);
</xsl:for-each>
</script>
But if there is a apostrophe ' in /request/alldata it will break the JavaScript because the following expression is enclosed in apostrophes:
'<xsl:value-of select="." />'
But it works if I replace this with either of the following...
"<xsl:value-of select="." />" OR "<xsl:value-of select='.' />"
Now I know the apostrophe ' is clashing with the JavaScript code, but which solution will work in all browsers?