I have an xml string which I am setting as body and transforming that xml into required ones. XML String:
XML_STRING= "<A><B>abc</B><C>abc&ade</C></A>";
When
<set-body>@((String)context.Variables["XML_STRING"])</set-body>
<xsl-transform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes" />
<xsl:template match="/">
<xsl:copy-of select="A" />
</xsl:template>
</xsl:stylesheet>
</xsl-transform>
I am getting the below error:
xsl-transform (0.398 ms)
{
"messages": [
null,
"Invalid Xml passed to transform: ' ' is an unexpected token. The expected token is ';'. Line 1, position 2612.",
"' ' is an unexpected token. The expected token is ';'. Line 1, position 2612."
]
}
When I am changing "&" from xml_string to & it works fine. But I want to know that how we can replace it using code.