I am trying to convert string to xml with using of loadXML.
<name>alex</name>
-> when string is well formatted for xml conversion, there is no issue.
<result> 5 < 3 </result>
-> but when string has invalid characters for xml value, it throws an exception.
How can I convert string with invalid characters to XmlDocument? Is there any way to replace invalid characters with xml escape characters without touching tags in string?
Is there any way to change <result> 5 < 3 </result>
to <result> 5 < 3 </result>
in string without touching tags ?