These special character (<,>,',",&) will be encode first when making xml because on these special character the xml will broke.
The below function is used when string containing the above special character,
In C# this line of code is used when string containing special character and you make xml query and use string in xml query like in fetchXml query.
string str = SecurityElement.Escape(str);
The below function is used when string containing the above special character,
function specialXmlCharacterEncode(str) {
return String(str)
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '<')
.replace(/>/g, '>');
}
In C# this line of code is used when string containing special character and you make xml query and use string in xml query like in fetchXml query.
string str = SecurityElement.Escape(str);
No comments:
Post a Comment