user15382501
user15382501

Reputation: 31

Escape backslash character in synapse?

I have to form the xmlbody for soap service and XML body contains xmlnamespace which contains URL enclosed with double quotes , I am forming this xmlbody via SQL statement because some tag I get values from the table and when I use lookup actity and run the pipeline I see the namespace add backslash before quotes ?

SELECT 'xmlns:xsl="http://www.w3.org/1999/XSL/Transform">' AS xmlbody FROM temptable;

I see the output comes as xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">

I tried all kind of replace double slash with empty string and other things but I didn't able to remove that extra backslash, I am expecting the output like this xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Upvotes: 0

Views: 63

Answers (1)

Bhavani
Bhavani

Reputation: 5317

SELECT 'xmlns:xsl="http://www.w3.org/1999/XSL/Transform">'

Your giving 'xmlns:xsl="http://www.w3.org/1999/XSL/Transform">' in single quote ('') so, it is taking as string, in ADF '\' used to mention the value as string that may be the reason to get your output as xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

For your clarification you can check with string length both will be equal. Create set variable varlength with @string(length(activity('Lookup1').output.value[0].xmlbody)) and querylen with @string(length('xmlns:xsl="http://www.w3.org/1999/XSL/Transform">')) then both lengths will be same as shown below:

enter image description here

Back slash('\') don't effect your requirement, so there is no need to remove it.

Upvotes: 0

Related Questions