I have a node with some data:
<something>Blah blah (Hello World) hihi</something>
When I perform an XSLt i am attempting to escape the open and close brackets and can not for the life of me work out how to achieve this so far I am attempting something like this.
<xsl:variable name="rb">(</xsl:variable>
<xsl:message><xsl:value-of select="replace(something, $rb, concat('\\', $rb))" /</xsl:message>
This is the error I am getting using Saxon:
Error at xsl:template on line 728 column 34 of something.xml:
FORX0002: Error at character 1 in regular expression “(“: expected ())
This will work for either bracket. Your code is also incomplete. What is something? Does it contain the value you expect? You are missing a > at the end of xsl:value-of.
EDIT : After @Dimitre’s comment :
The above would have the results you originally wanted, although I see no reason to prefer this over my original solution.