I am trying to create a xml text node using
XMLDocument.createtextnode(temp);
Case 1 -> if temp = "One&two"', then the value is being encoded properly by default with escape character as & as expected. I can see "&" on XML viewer, this is properly escaped with & when I open the XML in edit mode. Same is the case for "<" and ">".
Case 2: if temp = "One'two" or "one"two", single quote and double quotes are not encoded to ' and " as expected.
When I try to encode explicitly and pass the value to XMLDocument.createtextnode(System.Security.SecurityElement::Escape(temp))
String One'Two is encoded as One&apos;Two. Is there a way to encode One'Two to One'Two and
One"Two to One"Two?
Thanks,
Praveen
*This post is locked for comments
I have the same question (0)